fix(dynamic_component_loader): leave the view tree in a consistent state when hydration fails
Closes #5718
This commit is contained in:
@ -319,9 +319,15 @@ export class AppViewManager_ extends AppViewManager {
|
||||
}
|
||||
this._utils.attachViewInContainer(parentView, boundElementIndex, contextView,
|
||||
contextBoundElementIndex, index, view);
|
||||
this._utils.hydrateViewInContainer(parentView, boundElementIndex, contextView,
|
||||
contextBoundElementIndex, index,
|
||||
imperativelyCreatedInjector);
|
||||
|
||||
try {
|
||||
this._utils.hydrateViewInContainer(parentView, boundElementIndex, contextView,
|
||||
contextBoundElementIndex, index,
|
||||
imperativelyCreatedInjector);
|
||||
} catch (e) {
|
||||
this._utils.detachViewInContainer(parentView, boundElementIndex, index);
|
||||
throw e;
|
||||
}
|
||||
return view.ref;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user