<ngx-auth-firebaseui-avatar> links are not firing callback
See original GitHub issueBug Report or Feature Request (mark with an x
)
- [x ] bug report -> please search issues before submitting
- [ ] feature request
OS and Version?
Windows 10, Linux Mint
Versions
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / | | | | |/ _
| '__| | | | | | |
/ ___ | | | | (| | || | | (| | | | || | | |
// __| ||_, |_,||_,|| _|||
|___/
Angular CLI: 8.1.1 Node: 10.15.2 OS: win32 x64 Angular: 8.1.1 … animations, cli, common, compiler, compiler-cli, core, forms … language-service, platform-browser, platform-browser-dynamic … router, service-worker
Package Version
@angular-devkit/architect 0.801.1 @angular-devkit/build-angular 0.801.1 @angular-devkit/build-optimizer 0.801.1 @angular-devkit/build-webpack 0.801.1 @angular-devkit/core 8.1.1 @angular-devkit/schematics 8.1.1 @angular/cdk 8.0.2 @angular/fire 5.2.1 @angular/flex-layout 8.0.0-beta.26 @angular/material 8.0.2 @angular/pwa 0.801.1 @ngtools/webpack 8.1.1 @schematics/angular 8.1.1 @schematics/update 0.801.1 rxjs 6.4.0 typescript 3.4.5 webpack 4.35.2
Repro steps
After installing ngx-auth-firebaseui correctly, Typescript of:
links: LinkMenuItem[] = [ { text: 'Privacy Policy', icon: null, callback: this.callback1, }, { text: 'Terms of Service', icon: null, callback: () => { debugger; this.router.navigate(['/test']); } } ]; public callback1() { debugger; }
HTML of:
<ngx-auth-firebaseui-avatar [links]="links"></ngx-auth-firebaseui-avatar>
The log given by the failure
Desired functionality
The links are displayed within the menu that opens when clicking the avatar icon, however the links appear to do nothing, and not fire the callback. I would think at least on of the functions should have been hit. Am I doing something wrong?
Mention any other details that might be useful
I can’t get the icon field to work as well 😔
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
Just updated to v.3.2.6, both the icon and callbacks are working as expected. Thank you @AnthonyNahas This update is much appreciated and very useful!
After some researches on the code, it shows that the reason for the navigation error is that “this” is not bound. To fix, just use the below syntax for the callback: