Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/angularfire2/index has no exported member 'AngularFire'

Can't fix this problem:

app.component.ts

import { AngularFire, AuthProviders, AuthMethods } from 'angularfire2';

/angularfire2/index has no exported member 'AngularFire',
/angularfire2/index has no exported member 'AuthProviders',
/angularfire2/index has no exported member 'AuthMethods '

but in app.module.ts

import { AngularFireModule } from 'angularfire2';

works fine and I can initialize the app

package.json

"angularfire2": "^4.0.0-rc.0",
"core-js": "^2.4.1",
"firebase": "^3.9.0",
...
"devDependencies": {...
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
like image 760
Katya Katerinaa Avatar asked May 04 '17 08:05

Katya Katerinaa


People also ask

What is AngularFireAuth?

AngularFireAuth. user provides you an Observable<User|null> to monitor your application's authentication State. AngularFireAuth promise proxies an initialized firebase. auth. Auth instance, allowing you to log users in, out, etc.

How do I import into AngularFirestore?

First you'll want to inject the AngularFirestore injectable into your component: import { Component } from '@angular/core'; import { AngularFirestore } from 'angularfire2/firestore'; @Component({ ... }) export class AppComponent { constructor( private afs: AngularFirestore ) { // ... } }

What is AngularFireDatabase?

AngularFireDatabase is a service which can be injected through the constructor of your Angular component or @Injectable() service. In the previous step, we modified the /src/app/app. component. ts to retrieve data as an object.


1 Answers

Since you are using [email protected]+, there is no AngularFire exported any more. Instead, you shall use it as below:

// import AngularFireAuthModule at NgModule
import { AngularFireAuthModule } from 'angularfire2/auth';


import { AngularFireAuth } from 'angularfire2/auth';
// inject 
construstor(afa: AngularFireAuth) {
  afa.auth.signInWithPopup()
}
like image 152
Pengyy Avatar answered Nov 10 '22 00:11

Pengyy