javascript - Angular [ngClass] vs [class -
what difference in angular between following snippets:
<div [class.extra-sparkle]="isdelightful"> <div [ngclass]="{'extra-sparkle': isdelightful}">
this special angular binding syntax
<div [class.extra-sparkle]="isdelightful"> this part of angular compiler , can't build custom binding variant following binding style. supported [class.xxx]="...", [style.xxx]="...", , [attr.xxx]="..."
ngclass normal angular directive can build
<div [ngclass]="{'extra-sparkle': isdelightful}"> ngclass more powerful. allows bind string of classes, array of strings, or object in example.
Comments
Post a Comment