angularjs - Add Controller outside of View -
i using requirejs
alongside angularjs
, want give body controller.
the important elements nav
, .container
.
now, .container
changes automatically route, want give navigation controller can change current active tab. don't understand, however, how give nav
controller static element , isn't loaded alongside route , loaded before async scripts (angular, etc...) have loaded, can't use ng-controller directive.
if you're using ui-router, create abstract state under exists app. clarify, nav still part of app, primary application sit underneath ui-view
directive.
edit can read abstract states on documentation page. bonus, if use controlleras, child controller prototypical inherit properties of parent. keeps application scope open, nice , clean.
Comments
Post a Comment