2 回答

TA貢獻1836條經(jīng)驗 獲得超13個贊
// .html file
<div class="center" *ngIf="showColumn">
<div class="chart-header">Charts</div>
<div>Chart will display here</div>
</div>
//.ts file
showColumn = false;
this.form.get('inputCtrl').valueChanges.subscribe(() => {
this.showColumn = true;
});

TA貢獻1798條經(jīng)驗 獲得超3個贊
您可以訂閱表單控制器的 valueChanges 事件
TS文件
this.form.get("inputCtrl").valueChanges.subscribe(selectedValue => {
this.displayStyle = 'block';
})
HTML 文件
<div class="center" [ngStyle]="{'display':displayStyle}>
<div class="chart-header">Charts</div>
<div>Chart will display here</div>
</div>
- 2 回答
- 0 關(guān)注
- 109 瀏覽
添加回答
舉報