Page 1 of 1
Compilation issue while setting up sidebar
Posted: 10 Jul 2017, 19:40
by brianly
I am having issues setting up the sidebar on an already existing asp.net mvc core application. I believe I have imported all the necessary files to have the side bar running: app.menu.component.ts, app.menu.component.html, app.sidebar.component.ts, app.sidebar.component.html, app.sidebartabcontent.component.ts. Think I have setup all the dependencies correctly in app.component and app.module. But am getting this error:
Property 'eventEmitter' does not exist on type 'MenuItem'.
Am I missing another dependency for app.menu.component.ts ?
Re: Compilation issue while setting up sidebar
Posted: 10 Jul 2017, 23:52
by brianly
Never mind figured it out, the update from to angular 4.2 caused eventemitter to break
Re: Compilation issue while setting up sidebar
Posted: 11 Jul 2017, 08:43
by DarthMaul
Hi,
We will update all layouts to the latest versions of angular (4.2.x) and primeng (4.1.0) soon.
Code: Select all
itemClick(event: Event, item: MenuItem, index: number) {
//avoid processing disabled items
if(item.disabled) {
event.preventDefault();
return true;
}
//activate current item and deactivate active sibling if any
this.activeIndex = (this.activeIndex === index) ? null : index;
//execute command
if(item.command) {
item.command({
originalEvent: event,
item: item
});
}
//prevent hash change
if(item.items || (!item.url && !item.routerLink)) {
event.preventDefault();
}
//hide menu
if(!item.items && (this.app.overlay || !this.app.isDesktop())) {
this.app.sidebarActive = false;
}
}
But before that, you can use it like this.
Regards