📜  角度 onChange onChanges SimpleChanges - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:56.601000             🧑  作者: Mango

代码示例1
export class MyClassName implements OnInit,OnChanges {
 @Input() documents: Document[] = [];
.....
ngOnChanges(changes: SimpleChanges){
    console.log("changes ", changes)
    if(changes.documents){
      console.log("changes2 ", changes)
    }
  }