I've tried to setup an angular2-seed project which works now but now I want to add PrimeNG to my environment but I got stuck with it.
off course my first step: was installing primeng and primeui
npm install primeng --save
npm install primeui --save
Then I added a mapping @ https://github.com/mgechev/angular2-seed/blob/master/tools/config/seed.config.ts#L129
My component looks like this:
import {Component} from 'angular2/core';
import {CORE_DIRECTIVES, FORM_DIRECTIVES} from 'angular2/common';
import {PieChart} from 'primeng/primeng';
@Component({
selector: 'sd-stats',
moduleId: module.id,
templateUrl: './stats.component.html',
styleUrls: ['./stats.component.css'],
directives: [FORM_DIRECTIVES, CORE_DIRECTIVES, PieChart]
})
export class StatsComponent {
data: any[];
constructor() {
this.data = [{
value: 300,
color: '#F7464A',
highlight: '#FF5A5E',
label: 'Red'
},
{
value: 50,
color: '#46BFBD',
highlight: '#5AD3D1',
label: 'Green'
},
{
value: 100,
color: '#FDB45C',
highlight: '#FFC870',
label: 'Yellow'
}];
}
}
html file
<p-pieChart [value]="data" width="300" height="300"></p-pieChart>
This all wasn't enough: I think I still need to add the following css & js files but I don't know where!
<link rel="stylesheet" type="text/css" href="node_modules/primeui/themes/delta/theme.css" />
<link rel="stylesheet" type="text/css" href="node_modules/primeui/primeui-ng-all.css" />
<script src="node_modules/primeui/primeui-ng-all.js"></script>
and I'm not sure if the previous steps where correct as well. At the moment I got the error:
EXCEPTION: ReferenceError: Chart is not defined