0
是否可以在ngStyle指令中爲屬性添加多個值?例如像:ngStyle對象表達式屬性角度2的多個值
<div [ngStyle]='{"background" : ["rgba(248,80,50,1)", "-webkit-gradient(left top, right top, color-stop(0%, rgba(248,80,50,1)), color-stop(50%, rgba(241,111,92,1)), color-stop(51%, rgba(246,41,12,1)), color-stop(71%, rgba(240,47,23,1)), color-stop(100%, rgba(231,56,39,1)))"]}' ></div>
感謝
感謝您的重播,我需要加載樣式dinamically,所以我認爲ngClass指令不能這樣做,與stylesUrl相同。 –
我明白了。我沒有從你的例子中明白這一點。我確實找到了一個[示例](http://stackoverflow.com/questions/21364445/apply-css-style-attribute-dynamically-in-angular-js)如何使用Angular 1來做到這一點。也許你可以翻譯它讓Angular 2做你想做的事。希望有所幫助。 – Mickers