生命週期鉤子
活動可用性
AfterViewInit 和 AfterViewChecked 僅適用於元件,不適用於指令。
活動訂單
OnChanges(多次)OnInit(曾經)DoCheck(多次)AfterContentInit(曾經)AfterContentChecked(多次)AfterViewInit(一次)(僅限元件)AfterViewChecked(多次)(僅限元件)OnDestroy(一次)
AfterViewInit 和 AfterViewChecked 僅適用於元件,不適用於指令。
OnChanges(多次)OnInit(曾經)DoCheck(多次)AfterContentInit(曾經)AfterContentChecked(多次)AfterViewInit(一次)(僅限元件)AfterViewChecked(多次)(僅限元件)OnDestroy(一次)