How to detect when Angular has attached elements to the DOM?

前端 未结 3 1501
情深已故
情深已故 2021-01-15 17:22

There is a component:

it\'s component receives a stream of numbers as @Input

3条回答
  •  星月不相逢
    2021-01-15 17:54

    this happens in NgInit

    https://angular.io/guide/lifecycle-hooks

    ngOnInit()
    Initialize the directive/component after Angular first displays the data-bound properties and sets the directive/component's input properties.

    Called once, after the first ngOnChanges().

    Update:

    I have propably misunderstood your question. You dont have any update on the ngFor. What is your usecase? Maybe there are different solutions for this.

提交回复
热议问题