Can someone help me with the integration of angular 5 with firebase real time?

Asked

Viewed 70 times

-1

I need to integrate the firebase database to an application in angular 5. I took the code generated by firebase, created a firebase config file and put it there I made the import in the module. I’m having trouble writing in the bank and getting the information from there. Could someone help me?

  • face takes the image of keys, otherwise anyone will be able to see.

  • The keys are illustrative

  • https://github.com/angular/angularfire2

1 answer

0

enviroment.ts

export const environment = {
  production: false,
  firebase: //copiar o objeto de configuração.    
  apiUrl: suaUrl
};

app.modulets.

import { AppComponent } from './app.component
import { AppRoutingModule } from './app-routing.module';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AngularFireModule } from 'angularfire2';
import { AngularFireAuth } from 'angularfire2/auth';
import { environment } from '../environments/environment';

@NgModule({
  declarations: [
    AppComponent       
  ],
  imports: [
    BrowserModule,
    AngularFireModule.initializeApp(environment.firebase),,
  ],
  providers: [AngularFireAuth],//se quiser usar a auth do firebase
  bootstrap: [AppComponent]
})
export class AppModule { }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.