Compilation issue while setting up sidebar

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
brianly
Posts: 4
Joined: 24 May 2017, 17:32

10 Jul 2017, 19:40

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 ?

brianly
Posts: 4
Joined: 24 May 2017, 17:32

10 Jul 2017, 23:52

Never mind figured it out, the update from to angular 4.2 caused eventemitter to break

User avatar
DarthMaul
Posts: 582
Joined: 23 Nov 2015, 21:20

11 Jul 2017, 08:43

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

Post Reply

Return to “Atlantis - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests