0
私はtypescriptですでフォームエクスポートクラスに来ている条件値を取得しようとしているが、それは私の[オブジェクトHTMLDivElement]typescriptで動的に属性に値をバインドする方法Angular2?
@Component({
template:`<div #noRecordFoundMsg class="ui-widget-header ui-helper-clearfix"
style="padding:4px 10px;border-bottom: 0 none;display:{{ displayAttribute }}"> <-----here
<span>{{ noRecordFoundMsg }}</span>
</div>`})
private displayAttribute: string;
exported class Demo{
//some code
if (Counts === 0) {
this.noRecordFoundMsg = "No Record Found";
this.displayAttribute = "none";
} else {
this.displayAttribute = "block";
}
}
はい、私は試みたが、まだ同じ問題に直面して:(さえも試み[ngStyle] = "{ '表示':displayAttribute}" –
申し訳ありませんが、それは '[attr.style.display]' – AngJobs
同じ問題【オブジェクトでなければなりませんHTMLDivElement] –