node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org ยป



Angular 2 Component Router for Angular 1

This is an extract directly built from Angular 2 source code without modification. Adding this as an npm package, because Angular hasn't released an official version yet.

Sample Usage

Check out for sample usage (or to reproduce any errors or issues)

For more usage scenarios, check out

Based on Angular 2 Commit


Procedure of Extraction

As discussed on

  • Install gulp globally npm install -g gulp@latest
  • Clone the angular 2 repo: git clone angular2
  • Go into the angular2 directory and install the dependencies cd angular2 and npm install
  • After npm finishes, run the gulp command to build the router file gulp
  • The angular_1_router.js file will be in your angular2/dist folder.

Changes applied

  • Replaced unnecessary arrow function on line 3165: config = angular.extend({}, config, { loader: $injector.invoke(loader) });


This package is out there solely for convenience. You may directly import the router from Angular's npm package. Read more about on