I think you are missing the value of a "one-page application."
This does not mean that you will physically have one .html, instead you will have one main index.html and several NESTED.html files. So why a single page application? Because this way you do not load pages in the standard way (i.e. a Browser call that completely refreshes the full page), but you just load some of the content using Angular / Ajax. Since you do not see the flicker between page changes, it seems that you have not moved from the page. This way you feel that you are on the same page.
Now I assume that you want to have MULTIPLE content for your SINGLE PAGE application: (for example, home, contacts, portfolio and store. Your single-page / multi-page application (angular method) will be organized as follows:
index.html : contains header, <ng-view> and footercontacts.html : contains the contact form (no header, no footer)portfolio.html : contains portfolio data (without header)store.html : contains the store, without a header.
You are in the index, you click on the menu called "contacts" and what happens? angular replaces the <ng-view> with contacts.html code
How do you achieve this? with ngRoute , as you do this, you will have something like:
app.config(function($routeProvider, $locationProvider) { $routeProvider .when('/', { templateUrl: "templates/index.html", controller:'MainCtrl', }) .when('/contacts', { templateUrl: "templates/contacts.html", controller:'ContactsCtrl', }) .otherwise({ template: 'does not exists' }); });
This will call the correct html, passing it the right controller (note: do not specify the ng-controller directive in contacts.html if you use routes )
Then of course you can declare so many ng-controller directives inside your contactss.html page. These will be child ContactCtrl controllers (thus inheriting from it). But for one route, inside routeProvider , you can declare one controller that will act as the "Father of the partial view controller".
EDIT Imagine the following templates /contacts.html
<div> <h3>Contacts</h3> <p>This is contacts page...</p> </div>
the above routeProvider will inject the controller into your containing div. Basically the above html automaticaly becomes:
<div ng-controller="ContactsCtrl"> <h3>Contacts</h3> <p>This is contacts page...</p> </div>
When I say that you may have other controllers, you can connect the controllers to the internal elements of the DOM, as shown below:
<div> <h3>Contacts</h3> <p ng-controller="anotherCtrl">Hello {{name}}! This is contacts page... </p> </div>
Hope this makes a little difference.
BUT