@@ -34,7 +34,8 @@ In 4.0 we've reduced the complexity of the auth module by providing only a [`fir
3434
3535``` typescript
3636import { AngularFireAuth } from ' angularfire2/auth' ;
37-
37+ // Do not import from 'firebase' as you'd lose the tree shaking benefits
38+ import * as firebase from ' firebase/app' ;
3839...
3940
4041user : Observable < firebase .User > ;
@@ -49,7 +50,7 @@ While convenient, the pre-configured login feature added unneeded complexity. `A
4950
5051``` typescript
5152login () {
52- this .afAuth .auth .signInWithPopup (new GoogleAuthProvider ());
53+ this .afAuth .auth .signInWithPopup (new firebase . auth . GoogleAuthProvider ());
5354}
5455logout () {
5556 this .afAuth .auth .signOut ();
@@ -70,10 +71,12 @@ import { Observable } from 'rxjs/Observable';
7071import { AngularFireModule } from ' angularfire2' ;
7172import { AngularFireDatabaseModule , AngularFireDatabase , FirebaseListObservable } from ' angularfire2/database' ;
7273import { AngularFireAuthModule , AngularFireAuth } from ' angularfire2/auth' ;
73- import { GoogleAuthProvider } from ' firebase/auth' ;
74- import { User } from ' firebase' ;
7574import { environment } from ' ../environments/environment' ;
7675
76+ // Do not import from 'firebase' as you'd lose the tree shaking benefits
77+ import * from ' firebase/app' ;
78+
79+
7780@NgModule ({
7881 declarations: [ App ],
7982 exports: [ App ],
@@ -96,14 +99,14 @@ export class MyModule { }
9699 `
97100})
98101export class App {
99- user: Observable <User >;
102+ user: Observable <firebase . User >;
100103 items: FirebaseListObservable <any []>;
101104 constructor (afAuth : AngularFireAuth , db : AngularFireDatabase ) {
102105 this .user = afAuth .authState ;
103106 this .items = db .list (' items' );
104107 }
105108 login() {
106- this .afAuth .auth .signInWithPopup (new GoogleAuthProvider ());
109+ this .afAuth .auth .signInWithPopup (new firebase . auth . GoogleAuthProvider ());
107110 }
108111 logout() {
109112 this .afAuth .auth .signOut ();
0 commit comments