Skip to content

Add external dependency

Minko Gechev edited this page Jan 22, 2016 · 35 revisions

In his example we'll show how you can add angular2-jwt to the angular2-seed.

  1. Install the npm dependency.
npm install angular2-jwt --save
  1. Reference the dependency inside of any TypeScript file part of the project.

Inside about.ts use:

import * as jwt from 'angular2-jwt/angular2-jwt';
// ...
console.log(jwt.AuthConfig);

For such library you don't need NPM_DEPENDENCIES, since in dev it is loaded with SystemJS, and in production browserify will bundle it based in the reference in about.ts.

Clone this wiki locally