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

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -