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

Angular 将主组件的数据绑定到子组件的数据中失败

Angular 将主组件的数据绑定到子组件的数据中失败

一只甜甜圈 2019-01-05 18:23:42
将主组件的数据绑定到子组件的数据中失败相关代码<!--主组件模版-->   <div class="container">     <app-qa *ngIf="gameStart"></app-qa>     <app-readme [readed]="isRead"></app-readme>   </div><!--子组件模版--><div id="readMe" class="{{readMeClass}}" *ngIf="readed"></div>// 主组件代码export class AppComponent {   title = 'MBTI-16种人格类型测试';   isRead:boolean = false;   gameStart:boolean = false; }// 子组件代码export class ReadmeComponent implements OnInit {   readMeClass:string = "";     readed:boolean;  constructor() { }   ngOnInit() {   } }返回错误compiler.js:2547 Uncaught Error: Template parse errors: Can't bind to 'readed' since it isn't a known property of 'app-readme'.
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 427 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信