Open artaommahe opened 5 years ago
This is still an issue in v9: Updated StackBlitz
It is strange that this only happens with <ng-container *ngIf="...">
(we need both ng-container
and ngIf
). (I will also add the comp: core
label, because I am not sure this can be fixed purely in @angular/elements
.)
π bug report
Affected Package
The issue is caused by package @angular/elements
Is this a regression?
Dunno
Description
Wrong OnInit hooks call order when custom elements (parent + child) are added with some delay after (regular) angular component inited.
π¬ Minimal Reproduction
https://stackblitz.com/edit/angular-elements-init-order?file=app%2Fapp.component.html
*ngIf="visible"
with*ngIf="true"
window.setTimeout
withinnerHTML
usage in AppComponent's OnInit hook<ng-container *ngIf="visible">
π Your Environment
Angular Version: 7.1.4
Anything else relevant?
No such issue with native custom elements and
setTimeout
+innerHTML
usage https://stackblitz.com/edit/custom-elements-init-order?file=index.tsReal word use-case: adding unknown markup with custom elements from api response.