So -
I've downloaded and have the Ultima Theme working with PrimeNG Beta 17 components in our application - looks fantastic! But, I have a problem with menu items not activating in some cases.
I have two main components - a login component and a dashboard component. The first time a user logs in, everything seems to work fine. The second time the same users logs in, the menu items (specifically the top bar menu items) do not activate. If I click refresh, then everything is fine again until I log out.
On my dashboard component, I am calling:
ngAfterViewInit()
{
console.log("ngAfterViewInit called");
Ultima.init(this.el.nativeElement);
}
My gut tells me that the Ultima object doesn't like being re-initialized once it has been initialized, but perhaps there is something else going on. Any ideas? Is there anything I need to do in ngOnDestroy to clean up Ultima?
Thanks!
Paul
PrimeNG menu item problems.
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
-
- Posts: 33
- Joined: 01 Oct 2016, 02:08
Incidentally, I was able to work around this by doing the following when the user logs out:
(from my logout component)
public ngOnDestroy() : void
{
this.zone.runOutsideAngular(() => { location.reload(); });
}
This allowed me to work around the problem. But, I would like to know if there is a better way than this as I don't want to force reloads of my single page application!!
Thanks much everyone!
Paul
(from my logout component)
public ngOnDestroy() : void
{
this.zone.runOutsideAngular(() => { location.reload(); });
}
This allowed me to work around the problem. But, I would like to know if there is a better way than this as I don't want to force reloads of my single page application!!
Thanks much everyone!
Paul
-
- Posts: 33
- Joined: 01 Oct 2016, 02:08
I was able to reproduce this problem by:
Ultima.init(this.el.nativeElement);
Ultima.init(this.el.nativeElement);
Then, click on top-level menu items (like the gear). No response.
As Angular is a SPA framework, these Java script functions are going to get called multiple times without page reloads. I would consider this a defect. Please let me know if you guys feel differently or if there is something else I should be doing.
Thanks much!
Paul
Ultima.init(this.el.nativeElement);
Ultima.init(this.el.nativeElement);
Then, click on top-level menu items (like the gear). No response.
As Angular is a SPA framework, these Java script functions are going to get called multiple times without page reloads. I would consider this a defect. Please let me know if you guys feel differently or if there is something else I should be doing.
Thanks much!
Paul
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
We're working on this for next maintenance release. There is also the idea to make the menu as an Angular 2 component which eliminates the Ultima object altogether.
-
- Posts: 33
- Joined: 01 Oct 2016, 02:08
That would be awesome - thanks much for the reply!
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
-
- Information
-
Who is online
Users browsing this forum: No registered users and 3 guests