I can't make Angular2 work with a conditional ngClass styling and bootstrap labels.
<h1 [ngClass]="{'label label-warning': yourName=='Daniel',
'label label-success': yourName!='Daniel'}">
ngClass appears to be removing the first 'label' from a 'label label-success'
when I style my app. It correctly styles when the second conditional is met, but when the first conditional is met, the styling is incorrect.
On inspection of the element, when the second conditional has been met the style is h1.label.label-success
, however when the first condition is met it is incorrectly styled as h1.label-error
.
See this plunker for the error.
https://plnkr.co/edit/qJLWBzCXXUn7hNKEWXIs?p=preview
I have followed the AngularJS Upgrade guide (https://angular.io/docs/ts/latest/cookbook/a1-a2-quick-reference.html) but cannot get it to work correctly