angularjs - What to use to set styling dynamically in Angular? -


i started working angular , creating "little" project. came templating issue.

basically, try set colour elements dynamically angular. can't figure out best , "right" way it.

is ok use if statements in scope? or better use directive?

my main goal able set colors admin mode toolbar , icons.

thank answers.

https://docs.angularjs.org/api/ng/directive/ngclass

you can use ngclass expression.

if after coloring odd/even rows of table, use

https://docs.angularjs.org/api/ng/directive/ngclassodd https://docs.angularjs.org/api/ng/directive/ngclasseven


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -