|
|
|
@ -82,17 +82,11 @@ export class DynamicBootstrapper { |
|
|
|
|
* @param {OptionalBootstrapDefinition[]|undefined} definitions An optional set of components to bootstrap |
|
|
|
|
*/ |
|
|
|
|
public static bootstrapOptionalEmbeddable(appRef:ApplicationRef, element:HTMLElement, definitions = this.optionalBoostrapComponents) { |
|
|
|
|
// Avoid bootstrapping the embedded components while the app
|
|
|
|
|
// is running the Change Detection ("ApplicationRef.tick
|
|
|
|
|
// is called recursively" error)
|
|
|
|
|
appRef |
|
|
|
|
.isStable |
|
|
|
|
.pipe( |
|
|
|
|
filter(isStable => isStable), |
|
|
|
|
take(1), |
|
|
|
|
) |
|
|
|
|
.toPromise() |
|
|
|
|
.then(() => this.performBootstrap(appRef, element, true, definitions)); |
|
|
|
|
// Delay the execution to avoid bootstrapping the embedded components while
|
|
|
|
|
// the app is running the Change Detection ("ApplicationRef.tick is called recursively"
|
|
|
|
|
// error) caused because of bootstrapOptionalEmbeddable and bootstrapOptionalDocument
|
|
|
|
|
// calling this.performBootstrap at the same time
|
|
|
|
|
Promise.resolve().then(() => this.performBootstrap(appRef, element, true, definitions)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|