Installation
First include angular-componentrouter.js
in your HTML:
<script src="angular.js"> <script src="angular-componentrouter.js">
You can download this file from the following places:
- Google CDN
e.g.//ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/angular-componentrouter.js
- Bower
e.g.bower install angular-componentrouter@X.Y.Z
- code.angularjs.org
e.g."//code.angularjs.org/X.Y.Z/angular-componentrouter.js"
where X.Y.Z is the AngularJS version you are running.
Then load the module in your application by adding it as a dependent module:
angular.module('app', ['ngComponentRouter']);
With that you're ready to get started!
The new Angular Router
Module Components
Type
Name | Description |
---|---|
Router |
A |
ChildRouter |
This type extends the |
RootRouter |
This type extends the |
ComponentInstruction |
A |
RouteDefinition |
Each item in a 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 |
Directive
Name | Description |
---|---|
ngOutlet |
The directive that identifies where the |
Service
Name | Description |
---|---|
$rootRouter |
The singleton instance of the |
$routerRootComponent |
The top level Routing Component associated with the |
Please login to continue.