Question

With ng-controller="myController" you know exactly what DOM element is associated with the controller, because it's put directly into your HTML:

<div ng-controller="myController">

with $routeProvider, I don't know what DOM element is associated with the controller. Is the controller injected into the uppermost element on the DOM? According to the documentation, the controller is a JavaScript constructor function, and the controller is associated with the newly created scope. But I don't know where that newly created scope is?

Is the controller simply part of $routeProvider, and $routeProvider is an object?

Was it helpful?

Solution

ngView link

if you put

<div ng-view=""> your route will change html here </div>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top