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

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -