javascript - AngularJS module split among iFrames within single page -


i have webapp 1 module, 5 pages , 5 controllers. each html page declare same ng-app.

the pages loaded within widgets in web portal; is, each page loaded within iframe in portal. 5 controllers use same service, because each page loaded in iframe, service instanciated 5 times.

i'm not familiar angularjs i'm pretty sure there must clean way this. don't want load 5 times app.js, 5 times service...

i searched through web hours, couldn't find anything.

they way understand it, you're trying use external menu navigate through angular app within iframe? resulting in request of different html page on server everytime users clicks menu?

this implies you're invoking 5 different html pages on server, whom invoke each in turn ng-app directive, (re)instantiating appplication.

to prevent happening shouldn't invoke request of every single html page request application once loading index page , providing routes within application, user can navigate through.

here plunker example using ng-route.


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -