How to Destroy an Angular application?

470 views Asked by At

I have an Angular application, it is an simple application with routing. I have to include my application as a part of another website, the website load the app into a modal after loading all dependencies via RequireJS.

The opening of the app into a modal works fine.

When the modal is dismissed (and node us dismissed with the modal) I suppose the app is destroyed.

But after modal dismiss the app seems still in memory and if I open the modal again I didn't see the application loaded (and neither catch any error).

After first usage I obtain a blank page.

So I guess that I have to force app destroy on modal dismission.

Any suggestions?

=== UPDATE ===

I tryed to follow two different ways.

  1. using RequireJS undefine

    I receive an error message and it doesn't seems works

  2. include main.js via Ajax request

    I didn't receive any errors but it doesn't seems works

In any case I see that Angular app seems still works, I can read the messages in console log sent by Angular controllers but the render doesn't works.

When include the main.js for the second time I read all console log message except the message in main constructor.

0

There are 0 answers