I'm currently testing primeng with angular 2 and I want to create a simple menu.
Here my code :
import {Component, OnInit} from '@angular/core';
import {Menu, MenuItem} from 'primeng/primeng';
@Component({
templateUrl: 'app/salaries/menudroite.html',
selector: 'menu-droite',
providers: [],
directives: [Menu]
})
export class menuDroiteComponent implements OnInit {
private items: MenuItem[];
ngOnInit() {
this.items = [{
label: 'File',
items: [
{label: 'New', icon: 'fa-plus'},
{label: 'Open', icon: 'fa-download'}
]
},
{
label: 'Edit',
items: [
{label: 'Undo', icon: 'fa-refresh'},
{label: 'Redo', icon: 'fa-repeat'}
]
}];
}
}
and the html code
<h4>Menu droite</h4>
<p-menu [model]="items"></p-menu>
When I launch the website nothing shows up. If I remove the "p-menu" line in the html, I see the "h4" ...
What am I doing wrong ?