Manual Shutdown of an AngularJS App

2,906 views
Skip to first unread message

Derek Hall

unread,
Feb 20, 2013, 6:42:24 PM2/20/13
to ang...@googlegroups.com
Hello,

I have and AngularJS app embedded within a much larger JavaScript application. I manually bootstrap the angular app and everything works fine. However, I need to somehow stop the application without a page refresh. I want to be able to start/stop the angular app any number of times within the same page. I haven't found anything that would be like the opposite of the angular.bootstrap function. I've tried many things including $rootScope.$destroy or trying to nullify any global references to my app. I'm stuck and can't find a viable solution.

If anyone has any information on how I could accomplish this, it would be greatly appreciated.

Thanks,
Derek Hall

Derek Hall

unread,
Feb 23, 2013, 4:14:28 PM2/23/13
to ang...@googlegroups.com
I found a resolution for my issue. I ended up having to remove the angular portion of my html from the dom. I believe this destroys the angular app. So, basically anytime I want to start my app, I append the html to the dom and bootstrap the app. When I want to destroy it, I just remove it from the dom. This is the only thing I found that worked for starting/stopping my angular code within the same page without refreshing the page.

Once again, if anyone has a more elegant way of doing this, I would be interested.

Thanks,

-dhall
Derek Hall

Peter Bacon Darwin

unread,
Feb 23, 2013, 4:18:46 PM2/23/13
to ang...@googlegroups.com


--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Diwan Oli M

unread,
Apr 9, 2014, 8:28:32 AM4/9/14
to ang...@googlegroups.com
can you please provide the code snippet 
Reply all
Reply to author
Forward
0 new messages