angular6 Can't bind to 'zzst' since it isn't a known property of
文档: https://angular.io/guide/template-syntax#event-binding
The Angular compiler may reject these bindings with errors like this one:
content_copyUncaught Error: Template parse errors:
Can't bind to 'hero' since it isn't a known property of 'app-hero-detail'
You know that HeroDetailComponent
has hero
and deleteRequest
properties. But the Angular compiler refuses to recognize them.
The Angular compiler won't bind to properties of a different component unless they are Input or Output properties.
There's a good reason for this rule.
It's OK for a component to bind to its own properties. The component author is in complete control of those bindings.
But other components shouldn't have that kind of unrestricted access. You'd have a hard time supporting your component if anyone could bind to any of its properties. Outside components should only be able to bind to the component's public binding API.
Angular asks you to be explicit about that API. It's up to you to decide which properties are available for binding by external components.
TypeScript public doesn't matterlink
You can't use the TypeScript public and private access modifiers to shape the component's public binding API.
All data bound properties must be TypeScript public properties. Angular never binds to a TypeScript privateproperty.
Angular requires some other way to identify properties that outside components are allowed to bind to. That other way is the @Input()
and @Output()
decorators.
最新文章
- PHP多级联动的学习(一)
- http协议(四)http状态码
- [Asp.Net]状态管理(ViewState、Cookie)
- python 中time.sleep没有作用
- alpha阶段总结 说明
- 微软Office与金山WPS Office有何私密关系?
- xml中的特殊符号
- 关于DDS的基础知识
- heat-engine组件
- Windows下Oracle 11g的下载与安装
- 数据仓库:Mysql大量数据快速导出
- Learning-Python【13】:迭代器和生成器
- SSL、数字签名、CA 工作原理通俗描述
- 每天定时备份mysql数据库任务
- MFC和GTK的区别
- ArcGIS Javascript 图层事件绑定
- App Extension的脱壳办法
- 试题 B: 不同子串 蓝桥杯
- Django的安装创建与连接数据库
- 【Linux】- Ubuntu 配置mysql远程访问
热门文章
- Revit二次开发示例:DeleteObject
- 决策树(CART)
- 订单超时、活动过期解决方案:php监听redis key失效触发回调事件
- MyBatis之MyBatis环境搭建
- BZOJ 3926: [Zjoi2015]诸神眷顾的幻想乡 广义后缀自动机 后缀自动机 字符串
- [UOJ422]小Z的礼物
- [POI2015]Logistyka
- 【洛谷】4917:天守阁的地板【欧拉函数的应用】【lcm与gcd】【同除根号优化】
- 90. 子集 II
- Codeforces Round #361 (Div. 2) B. Mike and Shortcuts bfs