OnChangeslink
A lifecycle hook that is called when any data-bound property of a directive changes. Define an ngOnChanges()
method to handle the changes.
一个生命周期钩子,当指令的任何一个可绑定属性发生变化时调用。 定义一个 ngOnChanges()
方法来处理这些变更。
实现类
参见
方法
A callback method that is invoked immediately after the default change detector has checked data-bound properties if at least one has changed, and before the view and content children are checked. 如果至少发生了一次变更,则该回调方法会在默认的变更检测器检查完可绑定属性之后、视图子节点和内容子节点检查完之前调用。 | ||
参数
返回值
|
使用说明
The following snippet shows how a component can implement this interface to define an on-changes handler for an input property.
下列代码片段展示了组件要如何实现本接口来定义一个输入属性的变更处理器。