Angular 2, v. 2.0.0 + PrimeNG. I would implement popup menu like this:
I install PrimeNG in my project with this command -> npm install primeng --save
, and import TieredMenuModule
in my app.module.ts -> import {TieredMenuModule} from "primeng/primeng"
. Then i create component and import MenuItem -> import {MenuItem} from 'primeng/primeng'
, and all styles from node_modules (in my component of course):
import "../../../node_modules/primeng/resources/primeng.min.css";
import "../../../node_modules/primeng/resources/themes/omega/theme.css";
import "../../assets/font-awesome/css/font-awesome.min.css";
Then i add private items: MenuItem[]
and ngOnInit()
function:
public ngOnInit(): void {
this.items = [ ... ]
}
In my template i past this code:
<p-tieredMenu #menu [model]="items" [popup]="true"></p-tieredMenu>
<button #btn type="button" pButton icon="fa fa-list" label="Show" (click)="menu.toggle($event)"></button>
After all i get this:
The button are not blue and without label.
May be proble with style, or i dont import one more thing?