In my app, conditionally i am adding a class. and when the user enter something i am checking the value and accordingly i am adding the class name. it works fine.
but it only updates on set of (keyup)='0'
- setting some value on keyup
. this is not like angular 1
here.
so any one explain me why do we set the (keyup)=0
here? and what it do for us?
here is my code :
import {Component} from "angular2/core"
@Component({
selector : 'my-component',
template : `
<h2>My Name is: {{name}}
<span [class.is-awesome]="formReplay.value === 'yes' ">So good</span>
</h2>
<input type="text" #formReplay (keyup)="0" />
`,
styles : [`
.is-awesome{
color:green;
}
`]
})
export class MyComponent {
name = "My Name";
}