Jason
Jason

Reputation: 334

Child Component with structural directive (*ngif) is always executed last despite being placed ahead in the Parent Component html

I was working on a app where I encountered a peculiar case. For simplicity I have created a sample app and tested this although the behaviour was same.

Sample app:

In the parent component(my-app) I have the same child component with *ngIf and without it. The condition in *ngIf is mentioned upfront but despite it as you can see the method [check()] associated with it is executed last.

enter image description here

Excepted: The Method Check() should execute first and then Check2()

Upvotes: 0

Views: 428

Answers (0)

Related Questions