Complex angular js ng-class

后端 未结 5 1438
暗喜
暗喜 2020-12-23 16:40

I have the component and have a problem setting the css class to it. I want it to always have a class of \"box\", then to have additional classes specified by the directive

5条回答
  •  佛祖请我去吃肉
    2020-12-23 17:24

    Another way to do this without double curly braces and includes scope variables, tested with angular v1.2+.

    It's also rather nice because the variable can use different types as a index without increasing complexity using ternaries. It can also remove any need for negations ;) Here is a fiddle link

提交回复
热议问题