Skip to content

Angular 2 组件的生命周期 #56

Open
@kittencup

Description

@kittencup

接口

  • OnInit
  • OnDestroy
  • DoCheck
  • OnChanges
  • AfterContentInit
  • AfterContentChecked
  • AfterViewInit
  • AfterViewChecked

函数名

  • ngOnChanges - 当输入/输出绑定的值改变时调用
  • ngOnInit - 在第一次 ngOnChanges 后调用
  • ngDoCheck - 自定义的方法,检测和处理值的改变
  • ngAfterContentInit - 在组件内容初始化之后调用
  • ngAfterContentChecked - 组件每次检查内容时调用
  • ngAfterViewInit - 组件相应的视图初始化之后调用
  • ngAfterViewChecked - 组件每次检查视图时调用
  • ngOnDestroy - 指令销毁前调用。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @kittencup

        Issue actions

          Angular 2 组件的生命周期 · Issue #56 · kittencup/angular2-ama-cn