Gus*_*Gus 4 javascript css angularjs angularjs-ng-change ng-style
我有一个div具有ng-style属性,其rgba值使用$ scope变量作为alpha值:
ng-style="{'background-color': 'rgba(255,0,0,{{ alphaValue / 100}})'}"
Run Code Online (Sandbox Code Playgroud)
我有一个输入滑块,可以更改alphaValue的值.我可以使用console.log查看值的更改,并在html中的调试器中更新rgba值.它只是没有在视图中应用.
有什么建议?
它只是看起来像下面
ng-style="{'background-color': 'rgba(255,0,0,'+ (alphaValue/ 100) +')'}"
Run Code Online (Sandbox Code Playgroud)