angular - Angular2 [ngClass] Conditional fails with Spaces -
i have ngclass conditional functions fine on class names without spaces, when try below , toggle istrue on button click, class changes "btn btn-primary" "btn-default". space in there seems throwing off. missing something
[ngclass]="{ 'btn btn-default': istrue, 'btn btn-primary': !istrue}"
take common 1 out, , have rest of expression in ngclass
directive
class="btn" [ngclass]="{ 'btn-default': istrue, 'btn-primary': !istrue}"
Comments
Post a Comment