angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

injecting Angularfirestore into a service breaks navigation.

Open adamkoncz opened this issue 6 years ago • 1 comments

"@angular/animations": "~9.0.7",
"@angular/cdk": "^9.1.3",
"@angular/common": "~9.0.7",
"@angular/compiler": "~9.0.7",
"@angular/core": "~9.0.7",
"@angular/fire": "^6.0.0",
"@angular/forms": "~9.0.7",
"@angular/localize": "^9.1.3",
"@angular/material": "^9.1.3",
"@angular/platform-browser": "~9.0.7",
"@angular/platform-browser-dynamic": "~9.0.7",
"@angular/router": "~9.0.7",
"firebase": "^7.14.2",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"

After injecting AngularFirestore into a service like this

constructor(
    private afAuth: AngularFireAuth,
    private afFirestore: AngularFirestore
  ) 

Navigation to protected pages (by @angual/fire/auth-guard) stoppes working and a warning is displayed on the console

Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?

Potentially duplicate for https://github.com/angular/angularfire/issues/2452

The difference is that without injecting AngularFirestore into a service navigation and guards work just fine.

adamkoncz avatar May 17 '20 14:05 adamkoncz

This has been addressed in a recent patch release.

jamesdaniels avatar Nov 13 '20 01:11 jamesdaniels