Skip to content

Add external dependency

Sebastien de Salvador edited this page Mar 7, 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 src/about/components/about.component.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.component.ts.

Clone this wiki locally