-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Connecting to two Firebase Apps #846
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
Comments
@danielfliegauf Not sure if I got your question, but are you asking how to connect to firebase from your angular2 App. Also, you're not following the issue template. |
Hi Mukesh, My Question is: ¯_(ツ)_/¯--------------------------------------------------------- This is probably not right, is it? @NgModule({ ¯_(ツ)_/¯---------------------------------------------------------- It would be great if you could update your docs and show how to do it the right way. Thank you! :) |
up, |
Checkout #761 |
appears to be a duplicate of #761 can be closed |
@danielfliegauf . How did you solve the issue? While there have been many answers given, somehow I am not getting it. I was also wondering if we have to add the initialize method twice. How did you go about solving the issue? Thanks. |
The Firebase Docs describe quite nicely how to connect to two different apps.
// Initialize the default app
firebase.initializeApp(defaultAppConfig);
// Initialize another app with a different config
var otherApp = firebase.initializeApp(otherAppConfig, "other");
console.log(firebase.app().name); // "[DEFAULT]"
console.log(otherApp.name); // "other"
// Use the shorthand notation to retrieve the default app's services
var defaultStorage = firebase.storage();
var defaultDatabase = firebase.database();
// Use the otherApp variable to retrieve the other app's services
var otherStorage = otherApp.storage();
var otherDatabase = otherApp.database();
I found on your GithubPages the following:
https://github.com/angular/angularfire2/blob/master/docs/1-install-and-setup.md#custom-firebaseapp-names
But how do i get a reference within ng2 to this two firebase-apps? Could you maybe update your documentation?
Thank you a lot and 👍 for all this awesome work!!
Daniel
The text was updated successfully, but these errors were encountered: