-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add event to userMenu (header) #1637
Comments
+1 |
3 similar comments
+1 |
+1 |
+1 |
Hi, please, check this pr akveo/nebular#371 |
Is there a fix? I don't see it in the latest version. |
As per @Tibing's documentation I was able add events to the userMenu items. However the tag did not work even while setting the nbContextMenuTag. header.component.html
header.component.ts
|
Hi all, I really don't understand what is an issue. I've created stackblitz with an example, please, check it. |
Hi everyone, i did it like @pmadhavan explained and it woks for me, but, when I logout and login again without reload the page, goes directly to logout again, I think that is because the subscription is still alive, this doesn't happens when I reload the page. So I created a button instead, and i'll be waiting for a solution. I need learn more about observable. Sorry my english. |
@enviniom I facing the same problem, How to unsubscribe the subscription.?? |
How to dismiss the menu after click ?? |
I know this is an old issue, but I think I can provide a better solution than what I've read so far and maybe help someone facing this problem. When you create the subscription, assign it to a variable of type subscription, like:
and use the rest of @pmadhavan solution:
After that, you use angular's ngOnDestroy to unsubscribe.
With this you can keep this code on your header.component instead of movin it to app.component. :) |
http://prntscr.com/j59rot
The userMenu example is not working (or at least it does nothing).
I have been reading in @nebular and they speak about (itemClick) event
TEMPLATE: --> Adding (itemClick) to the example
<nb-action *nbIsGranted="['view', 'user']">
<nb-user [nbContextMenu]="userMenu" (itemClick)="onMenuItemClick($event)" [name]="user?.name" [picture]="user?.picture">
TS:
onMenuItemClick(event) {
console.log("CLICK", event) --> Dont trigger
}
node_components/@ nebular/theme/components/menu/menu.component.js
NbMenuItemComponent.prototype.onItemClick = function (item) {
console.log(item); ---> Triggers
this.itemClick.emit(item);
};
Sorry for my english
The text was updated successfully, but these errors were encountered: