Angular2更新绑定

Angular2更新绑定,angular,Angular,我有个小问题。我将在此示例中显示我的问题: export class UserComponent { users: User[] = new Array<User>(); removeAll(){ this.users = new Array<User>(); } } <button (click)="removeAll">Remove</button> <ul> &l

我有个小问题。我将在此示例中显示我的问题:

    export class UserComponent {
      users: User[] = new Array<User>();
      removeAll(){
       this.users = new Array<User>();
      }
    }

<button (click)="removeAll">Remove</button>
<ul>
<li *ngFor="let user of users>{{user.name}}</li>
</ul>
导出类用户组件{
用户:用户[]=新数组();
removeAll(){
this.users=新数组();
}
}
去除
    应该是

    (click)="removeAll"
    
    (click)="removeAll()"