K
K
ksivasid2016-06-08 18:33:25
Angular
ksivasid, 2016-06-08 18:33:25

How to remove a module after registering it through bootstrap?

Loading module angular.bootstrap(angular.element('#foo'), ['bar']);
After certain actions, I need to untie it from Angular in order to load it again later.
How can I do that ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ksivasid, 2016-06-09
@ksivasid

Or how can you activate the controller when there is no layout yet?
I will describe the problem in more detail, maybe there are other solutions:
There are 2 divs on the page that are not nested, something like this:

<div id="foo"></div>
<div id="bar"></div>

when the page loads, then in the div with id=foo there is an angular layout and I activate the module there
angular.bootstrap(angular.element('#foo'), ['bar']);

Everything works as it should, after manipulations in this module, I make an ajax request that returns already in <div id="bar">html and the layout of another angular module, I can also activate it
angular.bootstrap(angular.element('#bar'), ['baz']);
but if you change it again in the first module and send ajax to the server to redraw <div id="bar">it, then you cannot activate the module again, since it has already been activated.
Unfortunately, I can’t wrap the page in one module and the main controller, I can’t make requests to the server via $http either (such a project), I only have access to the formation <div id="foo"><div id="bar">of blocks.
And it is necessary that when changing in the first block and sending it to the server, the second block is redrawn.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question