【发布时间】:2017-01-14 23:57:45
【问题描述】:
我正在尝试了解 angular2 中的 OnInit 功能并阅读文档:
说明
实现该接口后执行自定义初始化逻辑 您的指令的数据绑定属性已被初始化。
ngOnInit 在指令的数据绑定属性之后调用 已经被第一次检查,并且在它的任何孩子之前 已检查。当指令被调用时它只被调用一次 实例化。
我不明白directive's data-bound properties是什么意思?
【问题讨论】:
-
目前提供的答案是错误的。根据docs,输入和数据绑定属性不是同一个概念。例如。这里:
Initialize the directive or component after Angular first displays the data-bound properties and sets the directive or component's input properties.
标签: angular