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

Popular posts from this blog

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

Ansible warning on jinja2 braces on when -

html - How to custom Bootstrap grid height? -