Last Updated: February 25, 2016
·
995
· st44100

Writing multiline ng-class in Jade

You can write like this ↓

div(
  ng-class= "{" +
    "'cls-a': type === 'a'," +
    "'cls-b': type === 'b'," +
    "'cls-c': type === 'c'," +
    "'cls-d': type === 'd'"
  "}"
).base-class
 p こんにちは

and You can edit all attribute at the same time.
LIke this ↓

pr.gif

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

AngularJS pages are long-lived browser apps with the same script risk as a newer single-page app. Third-party code in the template can read forms and values rendered on the page.

Security insights from Cside