Improve this Doc View Source $route
- $routeProvider
- service in module ngRoute
$route is used for deep-linking URLs to controllers and views (HTML partials). It watches $location.url() and tries to map the path to an existing route definition.
Requires the ngRoute module to be installed.
You can define routes through $routeProvider's API.
The $route service is typically used in conjunction with the ngView directive and the $routeParams service.
Dependencies
Methods
-  reload();
Events
-  $routeChangeStartBroadcasted before a route change. At this point the route services starts resolving all of the dependencies needed for the route change to occur. Typically this involves fetching the view template as well as any dependencies defined in resolveroute property. Once all of the dependencies are resolved$routeChangeSuccessis fired.Type:broadcastTarget:root scope
-  $routeChangeSuccessBroadcasted after a route dependencies are resolved. ngView listens for the directive to instantiate the controller and render the view. Type:broadcastTarget:root scope
-  $routeChangeErrorBroadcasted if any of the resolve promises are rejected. Type:broadcastTarget:root scope
-  $routeUpdateThe reloadOnSearchproperty has been set to false, and we are reusing the same instance of the Controller.Type:broadcastTarget:root scope
Properties
-  currentObjectReference to the current route definition. The route definition contains: - 
controller: The controller constructor as define in route definition.
- 
locals: A map of locals which is used by $controller service for controller instantiation. Thelocalscontain the resolved values of theresolvemap. Additionally thelocalsalso contain:- 
$scope- The current route scope.
- 
$template- The current route template HTML.
 
- 
 
- 
-  routesObjectObject with all route configuration Objects as its properties. 
This example shows how changing the URL hash causes the $route to match a route against the URL, and the ngView pulls in the partial.
    © 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
    https://code.angularjs.org/1.2.32/docs/api/ngRoute/service/$route