为了账号安全,请及时绑定邮箱和手机立即绑定

angular2在父组件怎么使用双向绑定来接收子组件输出的数据,而不是通过方法呢?

angular2在父组件怎么使用双向绑定来接收子组件输出的数据,而不是通过方法呢?

慕丝7291255 2019-05-24 19:05:33
@Input()count:number=5;@Output()countChange=newEventEmitter();change{this.count++;this.countChange.emit(this.count);}[(conut)]="conut"这个会报错Can'tbindto'conut'sinceitisn'taknownpropertyof'app-child-component'.1.If'app-child-component'isanAngularcomponentandithas'conut'input,thenverifythatitispartofthismodule.2.If'app-child-component'isaWebComponentthenadd'CUSTOM_ELEMENTS_SCHEMA'tothe'@NgModule.schemas'ofthiscomponenttosuppressthismessage.3.Toallowanypropertyadd'NO_ERRORS_SCHEMA'tothe'@NgModule.schemas'ofthiscomponent.
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 725 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号