ngRoute.ngView

directive in module ngRoute Overview ngView is a directive that complements the $route service by including the rendered template of the current route into the main layout (index.html) file. Every time the current route changes, the included view changes with it according to the configuration of the $route service. Requires the ngRoute module to be installed. Directive Info This directive creates new scope. This directive executes at priority level 400. Usage as element: (This directive

ngRoute.directive

Name Description ngView Overview ngView is a directive that complements the $route service by including the rendered template of the current route into the main layout (index.html) file. Every time the current route changes, the included view changes with it according to the configuration of the $route service.

ngRoute.$routeProvider.when()

when(path, route); Adds a new route definition to the $route service. Parameters Param Type Details path string Route path (matched against $location.path). If $location.path contains redundant trailing slash or is missing one, the route will still match and the $location.path will be updated to add or drop the trailing slash to exactly match the route definition. path can contain named groups starting with a colon: e.g. :name. All characters up to the next slash are matched and stored

ngRoute.$routeProvider.otherwise()

otherwise(params); Sets route definition that will be used on route change when no other route definition is matched. Parameters Param Type Details params Objectstring Mapping information to be assigned to $route.current. If called with a string, the value maps to redirectTo. Returns Object self

ngRoute.$routeProvider.caseInsensitiveMatch

caseInsensitiveMatch A boolean property indicating if routes defined using this provider should be matched using a case insensitive algorithm. Defaults to false.

ngRoute.$routeProvider

$route provider in module ngRoute Used for configuring routes. See $route for an example of configuring and using ngRoute. Dependencies Requires the ngRoute module to be installed. Methods when(path, route); Adds a new route definition to the $route service. Parameters Param Type Details path string Route path (matched against $location.path). If $location.path contains redundant trailing slash or is missing one, the route will still match and the $location.path will be update

ngRoute.$routeParams

service in module ngRoute The $routeParams service allows you to retrieve the current set of route parameters. Requires the ngRoute module to be installed. The route parameters are a combination of $location's search() and path(). The path parameters are extracted when the $route path is matched. In case of parameter name collision, path params take precedence over search params. The service guarantees that the identity of the $routeParams object will remain unchanged (but its properties w

ngRoute.$route.updateParams()

updateParams(newParams); Causes $route service to update the current URL, replacing current route parameters with those specified in newParams. Provided property names that match the route's path segment definitions will be interpolated into the location's path, while remaining properties will be treated as query params. Parameters Param Type Details newParams !Object<string, string> mapping of URL parameter names to values

ngRoute.$route.routes

routes Object Object with all route configuration Objects as its properties.

ngRoute.$route.reload()

reload(); Causes $route service to reload the current route even if $location hasn't changed. As a result of that, ngView creates new scope and reinstantiates the controller.