I am trying to start using angular 2 cli.
I want to use momentjs in my project so here is what I have done:
1. created project using angular cli.
2. run np
If library you want to include is not in typings you have two ways to include it in an angular 2 application:
using npm: step a. install library using package manager
step b. add path of the library to the map object in systemjs.config.js file.
example:
'jquery' : 'npm:jquery/dist/jquery.js', 'd3' : 'npm:d3/build/d3.js'
step c. import it in app.module.ts example:
import 'jquery'; import 'd3';
step d. declare it
example: declare var $: any;
declare var d3: any;