2 回答

TA贡献1836条经验 获得超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条经验 获得超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 关注
- 87 浏览
添加回答
举报