0
내가 타이프의 형태로 수출 클래스를 오는 조건 값을 얻으려고 노력하지만 나에게 [객체 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] –