0
我嘗試綁定ngStyle到NG-內容,這是行不通的,見下面的例子:如何綁定ngStyle到NG-conent在angular2
<ng-content select="panel-one" [ngStyle]="{'width':size+'px'}"></ng-content>
我互聯網上搜索只能找到下面的解決方案,
::content >>> panel-one {width:50px}
=>從https://plnkr.co/edit/T5CoP5qmd4nzIPAFjLNQ?p=preview
但它不能動態變化樣式值。