Dynamically Creating Components With Angular
Netanel Basal
1.3K30

Hey thanks for replying.

The problem I’m trying to solve is this.

I have a long lived component that maintains state. If this component or any of its sub-components fail, I want to be able to destroy this component and re-instantiate it.

By creating the component in a new zone, I should be able to receive errors thrown only by the component. I do this by registering a callback to the new zone’s onError hook. In this callback I can destroy and re-instantiate the component.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.