Is it possible to add script tag inside a partial/template in AngularJS? I can only use ng-view (with router) if I load the partial controller.js in the main page. This will not work well if you have a app with a lot of pages. I have heard about a JQuery fix, which I tried unsuccessful. I could solve it by using JSP, MVC4 or Wicket but that's a quite big overhead. I heard about the RequireJS solution but some say its not realy what RequireJS is for.
Asked
Active
Viewed 253 times
0
-
Anyone. Its an important question i believe. Anyone able to load controllers js for partial pages within the partial itself. I can see the need of linking to many partials if the mainframe page has many links in navigation panel.Furthermore pressing on a grid row might lead to special detail pages(also within the mainframe html page). Do AngularJS developers add all partial controllers in the main frame html head tag? Finding this hard to believe. Not very scalable – Jens Alenius Mar 12 '14 at 13:11
1 Answers
0
Here is an article that shows how to load AngularJS components with RequireJS after bootstrap.
and it's demo is here
http://bennadel.github.io/JavaScript-Demos/demos/loading-angularjs-with-requirejs-after-bootstrap/

David Smith
- 252
- 4
- 10