RooksStrife
RooksStrife

Reputation: 1747

Angular 2+ ngIf Not Stopping Child Component From Building

I have a parent component that calls in child component. I want an ngIf check to show/build or hide/don't build child component... no matter what the component is built even when not displayed (not in dom). Is there another way to stop this from happening?

Parent HTML Template:

<div>
  <child-comp *ngIf="1 == 0"></child-comp>
</div>

I am thinking that ngIf won't get me where I want to be.

Upvotes: 1

Views: 862

Answers (1)

developing2020
developing2020

Reputation: 322

Put your ngIf check in the outer div around your child-comp

Upvotes: 1

Related Questions