- Ir a Firebase Console 🔥.
- Has click en Agregar proyecto.

- Coloque el nombre que desee en Ingresa el nombre de tu proyecto, en esta ocasión HeroesFirebase. Dale en Continuar.

- Configuraciones Opcionales, de Google Analytics, dale en continuar (este servicio es gratuito).
- De click en Crear proyecto.

- De click en Web (como se muestra en la ilustración).

- Coloque un sobrenombre a su app, y da click en Siguiente.
- Copie las configuraciones que le da Firebase.

- Instala Firebase en Angular. Información obtenida del repositorio AngularFire.
npm install firebase @angular/fire --save
- Busca el archivo
src/app/environments/environment.tsy ajuste la siguiente información.
export const environment = {
production: false,
firebaseConfig: {
apiKey: "AIzaSyByEY95Dm7GhfXJzcw1TDJyHsMHMjUBpxo",
authDomain: "heroesfirebase-f69f9.firebaseapp.com",
databaseURL: "https://heroesfirebase-f69f9.firebaseio.com",
projectId: "heroesfirebase-f69f9",
storageBucket: "heroesfirebase-f69f9.appspot.com",
messagingSenderId: "716259620584",
appId: "1:716259620584:web:34bdfd3f02e13d87633b5d",
measurementId: "G-6KDSLYGFH0",
},
};- Busca el archivo
src/app/app.module.tsy agregemos dos imports.
import { AngularFireModule } from "@angular/fire";
import { environment } from "../environments/environment";- Ahora importa el modulo de AngularFireModule en el NgModule, de la siguiente manera debe quedar.
imports: [
BrowserModule,
AngularFireModule.initializeApp(environment.firebaseConfig),
],¡Lo que sigue es salsa!!
This project was generated with Angular CLI version 9.1.7.
Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.
Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.
Run ng test to execute the unit tests via Karma.
Run ng e2e to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use ng help or go check out the Angular CLI README.