Angular2 - Keyup 需要澄清

Angular2 - Keyup require a clarification

在我的应用程序中,我有条件地添加了一个 class。当用户输入内容时,我正在检查值,因此我添加了 class 名称。它工作正常。

但它仅在 (keyup)='0' 组上更新 - 在 keyup 上设置一些值。这不像这里的 angular 1

所以有人解释一下为什么我们在这里设置 (keyup)=0 吗?它对我们有什么作用?

这是我的代码:

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";   
}

Offical docs

@Component({
  selector: 'loop-back',
  template:`
    <input #box (keyup)="0">
    <p>{{box.value}}</p>
  `
})
export class LoopbackComponent { }

在官方文档中寻找这个。

This won't work at all unless we bind to an event.

Angular only updates the bindings (and therefore the screen) if we do something in response to asynchronous events such as keystrokes.

That's why we bind the keyup event to a statement that does ... well, nothing. We're binding to the number 0, the shortest statement we can think of. That is all it takes to keep Angular happy. We said it would be clever!