Idk if my subject is descriptive enough but i'll try my best to describe what I am doing. I really want to learn and understand Angular and I am coming from Backbone.js.
My set up is using RequireJS Angular and AngularAMD (http://marcoslin.github.io/angularAMD/)
I got my page set up fine using the routes that go out and get the different views from the view directories. HOWEVER, I am trying to pull out the navigation from the main page and put it in its own external view.
I have a feeling this is easy I am just not well versed enough in Angular to do it. I am thinking I need a navigationController but I am not understanding how I can load my external view like I can with the routes.
angular
.module('app', [
'ngRoute',
])
.config(config)
config.$inject = ["$routeProvider"];
function config($routeProvider) {
$routeProvider
.when('/', angularAMD.route({
templateUrl: 'views/home.html',
controller: 'homeController',
controllerUrl: 'controllers/home'
}))
}
So that is pretty straight forward that when my url is / it will load the home.html template and the proper controller. How do I get a navigation template loaded in there so that its included on all pages?Am I going to have to use a factory or something?
I just wanted everyone to know what I ended up doing was separating everything out into modules. Now I have a header, footer & navigation modules along with all sorts of other modules.
After ready here https://docs.angularjs.org/guide/module under "Recommended Setup" I feel this is probably the best approach for what I want to accomplish.