文档: 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.
angular6 Can't bind to 'zzst' since it isn't a known property of的更多相关文章
-
Angular4 - Can't bind to 'ngModel' since it isn't a known property of 'input'.
用[(ngModel)]="xxx"双向绑定,如:控制台报错:Can't bind to 'ngModel' since it isn't a known property of ...
-
Angular 报错 Can't bind to 'formGroup' since it isn't a known property of 'form'
错误描述 当form表单加FormGroup属性时报错 Can't bind to 'formGroup' since it isn't a known property of 'form' < ...
-
Angular: Can&#39;t bind to &#39;ngModel&#39; since it isn&#39;t a known property of &#39;input&#39;问题解决
https://blog.csdn.net/h363659487/article/details/78619225 最初使用 [(ngModel)] 做双向绑定时,如果遇见Angular: Can't ...
-
Angular - Can&#39;t bind to &#39;ngModel&#39; since it isn&#39;t a known property of &#39;input&#39;.
用[(ngModel)]="xxx"双向绑定,如:控制台报错:Can't bind to 'ngModel' since it isn't a known property of ...
-
Can&#39;t bind to &#39;ngModel&#39; since it isn&#39;t a known property of &#39;input&#39;.
angular项目启动报错 Can't bind to 'ngModel' since it isn't a known property of 'input'. 原因:当前module模块未引入 ' ...
-
在懒加载的Ionic工程中使用 ionic2-auto-complete 组件:Can&#39;t bind to &#39;dataProvider&#39; since it isn&#39;t a known property of &#39;ion-auto-complete&#39;
问题描述: 在基于懒加载的Ionic工程中,使用ionic2-auto-complete组件(GitHub地址:https://github.com/kadoshms/ionic2-autocompl ...
-
Can&#39;t bind to &#39;formGroup&#39; since it isn&#39;t a known property of &#39;form&#39;
在APP.module.ts中引入FormsModule, ReactiveFormsModule. import { BrowserModule } from '@angular/platform- ...
-
ANGULAR6.x - 错误随笔 - Can&#39;t bind to &#39;formGroup&#39;
formGroup:错误 Can't bind to 'formGroup' since it isn't a known property of 'form'. (" 原因: 在使用for ...
-
How to bind to data when the DataContext is not inherited【项目】
http://www.thomaslevesque.com/2011/03/21/wpf-how-to-bind-to-data-when-the-datacontext-is-not-inherit ...
随机推荐
-
Codeforces Round #388 (Div. 2)
# Name A Bachgold Problem standard input/output 1 s, 256 MB x6036 B Parallelogram is Back s ...
-
修改FreeBSD启动菜单停留时间
原文:http://blog.chinaunix.net/uid-21782158-id-11006.html 分类: 两种情况: 一.启动时出现菜单的时候要停的10秒 方法: 编辑/boot/loa ...
-
屏蔽同步(JAVA)
以全球气候预测程序为例.这些程序通过将地球分为许多单元,在每个循环中,每个单元的计算都是隔离进行的,直到这些值趋于稳定,然后相邻单元之间就会交换一些数据.所以,从本质上讲,在每个循环中各个线程都必须等 ...
-
类集对enum的支持。
1,EmumMap public class EnumMap<K extends Enum<K>,V>extends AbstractMap<K,V>impleme ...
-
leetcode 第二题Add Two Numbers java
链接:http://leetcode.com/onlinejudge Add Two Numbers You are given two linked lists representing two n ...
-
东芝MIPI解码TC358746AXBG和OV6211使用及配置
Camera Sensor常见的接口类型: 1.有并口信号(D0~D7.PCLK.HSYNC.VSYNC),一般的处理器有DCMI接口,如ST32F207x系列,直接相连就可以使用. 2.MIPI接口 ...
-
读Zepto源码之Stack模块
Stack 模块为 Zepto 添加了 addSelf 和 end 方法. 读 Zepto 源码系列文章已经放到了github上,欢迎star: reading-zepto 源码版本 本文阅读的源码为 ...
-
Java Web开发——MySQL数据库的安装与配置
MySQL是一个关系型数据库管理系统,由瑞典MySQL AB 公司开发,目前属于 Oracle 旗下产品.MySQL 是最流行的关系型数据库管理系统之一,在 WEB 应用方面,MySQL是最好的 RD ...
-
【Jsp】JSP自己定义标签与MODEL1、MODEL2标准
在JSP2.0之后支持自己定义标签,如今一般都是jsp2.4的版本号了,所以无须考虑版本号的问题. 直接使用就能够了.尽管一般开发的过程中,非常少会自己定义JSP标签.可是通过一个JSP自己定义标签的 ...
-
用openssl为EAP-TLS生成证书(CA证书,服务器证书,用户证书)
用openssl为EAP-TLS生成证书(CA证书,服务器证书,用户证书) 来源: https://www.cnblogs.com/osnosn/p/10597897.html 来自osnosn的博客 ...