I am a bit confused as to how to add a npm package like ng2-charts to my Angular2 TypeScript project.
By adding :
"ng2-charts": "1.0.3"
to my package.json file, it gets installed nicely, and when I add 'ng2-charts/ng2-charts' to my typescript page:
import {Component, Input, OnInit} from 'angular2/core';
import {Router, RouterLink, RouteParams} from 'angular2/router'
import {CHART_DIRECTIVES} from 'ng2-charts/ng2-charts';
@Component({
selector: 'detailMatch',
templateUrl: './app/components/match/detail.html',
directives: [RouterLink, CHART_DIRECTIVES]
})
It also works perfectly. The name CHART_DIRECTIVE is found automatically in Visual Studio when I type the first letter etc, but when I try to load the page I get:
http://localhost:5000/ng2-charts/ng2-charts.js 404 (Not Found)
This is because I don't have ng2-charts in that location:
It is stored in "lib\js\ng2-charts\ng2-charts.js" Like all my other js files for angular, http, bootstrap, router, Rx etc.
So how can I tell angular that the location of the .js files is in:
http://localhost:5000/lib/js/ng2-charts/ng2-charts.js