I do not know the error
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { UsuarioService } from '../providers/usuario/usuario';
// firebase
import {AngularFireModule} from 'angularfire2';
export const config={
apiKey: "AIzaSyArwGg8FfERure5UzpqB7tRqeehiyBOVjY",
authDomain: "tracker-d2863.firebaseapp.com",
databaseURL: "https://tracker-d2863.firebaseio.com",
projectId: "tracker-d2863",
storageBucket: "tracker-d2863.appspot.com",
messagingSenderId: "118251126046"
};
@NgModule({
declarations: [
MyApp,
HomePage,
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
AngularFireModule.initializeApp(config)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage,
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler},
UsuarioService
]
})
export class AppModule {}
usuario.ts
import { Injectable } from '@angular/core';
import { AngularFireDatabase } from 'angularfire2/database';
@Injectable()
export class UsuarioService {
constructor(private af: AngularFireDatabase) {
}
verifica_usuario(clave:string){
clave = clave.toLowerCase();
let promesa = new Promise ((resolve, reject)=>{
this.af.list('/usuarios'+clave).subscribe(data=>{
console.log(data);
resolve();
})
});
return promesa;
}
}
Runtime Error
UPreformatted text
ncaught (in promise): Error: No provider for AngularFireDatabase! Error: No provider for AngularFireDatabase! at injectionError