Closed mikhail-angelov closed 8 years ago
Hmm are you sure that it works ? Don't you think that it could have disastrous effect if you reset components that have might be used by the application ?
it's working at least in my case: I'm making application, which load modules dynamically depend on login user I do not like reset browser page on logout, so I reset angular contact (remove dom element connected with angular) and compose new angular content again.
here I faced with problem, since ocLazyLoad is not reloaded it keeps state, even if all angular app content is gone, and I did not find a way how to reset ocLazyLoad and make it properly init dynamic modules (it thinks all services and controllers already loaded, and does not register them any more) since you already have similar params (reconfig, rerun) which help to solve similar issue, I thought one more will be ok
I agree it may cause unexpected behavior if application content was not reset so it should be used responsibly :)
Then maybe we should offer a way to reset the internal arrays of ocLazyLoad instead ?
yes, it will work as well. we need just clean regInvokes map I can prepare such solution
Yeah, that would be better, and we could use it in the unit tests as well
pull request is updated, but I'm not sure the solution is better than previous one I did not manage to make unit test for it, because this function update internal state, which is not visible via API (
I copied your code and rewrote the commit because you were bumping the version in your commit. Thanks for the PR, it's available on master.
ok, thank you
Hi Sometime It's needed to reload dynamic modules and initialize them properly there are 2 useful params for it: rerun, reconfig It will be nice to add one more (e.g. renew), which force to register module components
BR Mikhail