我问了这个问题:Angular 2 Provider 的类比
但是在将 angular 更新为 rc.4 并将 @angular/forms 更新为 0.2.0 之后,它就不再起作用了。
部分模板:
<form [formGroup]="formGroup">
...
<checkbox-view [formControl]="formGroup.find('rememberMe')">Remember me?</checkbox-view>
</form>
在组件中:
this.formGroup = this._fromBuilder.group({
...
rememberMe: [this.model.rememberMe]
});
和错误: 没有值访问器''