Skip to content

@ViewChild annotation behaves incorrectly on nested ngIf. #6747

@CodingDante

Description

@CodingDante

For example,

<div *ngIf="parentCondition">
  <div *ngIf="childCondition1" #testedComponent1>
  </div>

  <div *ngIf="childCondition2">
     <div  #testedComponent2>
     </div>
  </div>
</div>

@ViewChild('testedComponent2')
set component2(....)

The set function will not be called if childCondition2 changes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions