Angular router activates outlet that is removed

Discussão em 'Angular' iniciado por Michał B, Abril 8, 2025.

  1. Michał B

    Michał B Guest

    I have dynamically added component with its own router outlet(for child paths):

    this.componentRef = this.modal.createComponent(ComponentA);


    After removing this component via destroy method:

    this.componentRef.destroy();


    any route that I'm activating is not appearing in main outlet. Instead of this when I'm adding ComponentA again route is opened in ComponentA outlet.

    Should I destroy ComponentA other way to avoid using its outlet?

    Continue reading...

Compartilhe esta Página