Improve this Doc ngComponentRouter

From Get docs

Improve this Doc ngComponentRouter


In an effort to keep synchronized with router changes in the new Angular, this implementation of the Component Router (ngComponentRouter module) has been deprecated and will not receive further updates. We are investigating backporting the Router for the new Angular to AngularJS, but alternatively, use the ngRoute module or community developed projects (e.g. ui-router).


Currently, the Component Router module must be installed via npm/yarn, it is not available on Bower or the Google CDN.

yarn add @angular/[email protected]

Include angular_1_router.js in your HTML:

<script src="/node_modules/@angular/router/angular1/angular_1_router.js"></script>

You also need to include ES6 shims for browsers that do not support ES6 code (Internet Explorer, iOs < 8, Android < 5.0, Windows Mobile < 10):

<!-- IE required polyfills, in this exact order -->
<script src=""></script>
<script src=""></script>
<script src=""></script>

Then load the module in your application by adding it as a dependent module:

angular.module('app', ['ngComponentRouter']);

Module Components


Name Description
Router A Router is responsible for mapping URLs to components.
ChildRouter This type extends the Router.
RootRouter This type extends the Router.
ComponentInstruction A ComponentInstruction represents the route state for a single component. An Instruction is composed of a tree of these ComponentInstructions.
RouteDefinition Each item in the RouteConfig for a Routing Component is an instance of this type. It can have the following properties:
RouteParams A map of parameters for a given route, passed as part of the ComponentInstruction to the Lifecycle Hooks, such as $routerOnActivate and $routerOnDeactivate.


Name Description
ngOutlet The directive that identifies where the Router should render its Components.


Name Description
$rootRouter The singleton instance of the RootRouter type, which is associated with the top level $routerRootComponent.
$routerRootComponent The top level Routing Component associated with the $rootRouter.

© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 3.0.