angularjs - Angular Avoid Unnecessary Dependency Injection -


i'm not building traditional spa, instead pages generate server-side. have angular app import pages on site. example:

var app = angular.module('app',['ui.bootstrap', 'ngtable','textangular']); 

quite simple question i've failed ask google right question(s) find answer. not pages require textangular example, yet angular app not load unless import script on every page. best practice avoid problem?

you don't need load script in every page. angular used in context of spa web app (single page application). means have 1 page (index.html) , use routing change current view. should reference script in index.html if module in application needs feature.

if using server generated pages (with asp .net, php, etc.) can add script references every page not usual way work angular. (it called mini spa application). if scenario have reference script textangular (and define dependency in module declaration) on pages need use it.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -