Firebase is a Backend-as-a-Service (BaaS) app development platform that provides hosted backend services such as real-time database, cloud storage, authentication, crash reporting, analytics, and so on. It is built on Google's infrastructure and scales automatically.
There are two different ways you can use Firebase in your projects:
React Native supports both the JS SDK and the native SDK. The following sections will guide you through when to use which SDK and all the configuration steps required to use Firebase in your Expo projects.
1. First, we need node.js. Install it from here if it is not already installed.
2. Install angular cli
npm install -g @angular/cli
3. Go to firebase
4. Sign Up or Log in there
5. From the top right corner, click Go To Console
6. Click Add Project and create a new project with the desired name.
7. From the project overview page, create a new web app.
8. On the bottom of the General tab, keep the config data for future use.
9. Go to the Cloud Messaging tab and Keep the Server Key and Sender ID.
10. On the bottom of the Web Push Certification section, click Generate key pair and keep the new generated key.
import { getFirestore, collection, addDoc } from "firebase/firestore";
2. updateDoc()- In order to update an existing document using the updateDoc() method, we need three methods:
import { getFirestore, doc, updateDoc } from "firebase/firestore";
import { getFirestore, doc, deleteDoc } from "firebase/firestore";
ng add @angular/fire
This command installs the @angular/fire package and asks you a few questions. In your terminal, you should see something like:
2. Next, we need to create a Firestore database! Under "Cloud Firestore" click "Create Database."
3. After that, create a database in test mode:
4. Finally, select a region:
5. When you create a new task in the user interface and open Firestore, you should see something like this:
<div class="prof-content align-self-center">
<p class="fs-12 Desc mb-0 text-light angular-with-newlines">
<span *ngIf="!message?.imageUrl"
[innerHTML]="message?.text | detectUrls"></span>
<img class="chat-img cursor-pointer"
[title]="message?.fileName"
(click)="open(0, message?.imageUrl)"
*ngIf="message?.messageType === 'Image'"
[src]="message?.imageUrl" />
<img class="chat-doc cursor-pointer"
[title]="message?.fileName"
(click)="openDocument(message?.imageUrl)"
*ngIf="message?.messageType === 'doc'"
src="/assets/images/doc.svg" />
<img class="chat-doc cursor-pointer"
[title]="message?.fileName"
(click)="openDocument(message?.imageUrl)"
*ngIf="message?.messageType === 'csv'"
src="/assets/images/csv.svg" />
<img class="chat-doc cursor-pointer"
[title]="message?.fileName"
(click)="openDocument(message?.imageUrl)"
*ngIf="message?.messageType === 'pdf'"
src="/assets/images/pdf-file.svg" />
<img class="chat-doc cursor-pointer"
[title]="message?.fileName"
(click)="openDocument(message?.imageUrl)"
*ngIf="message?.messageType === 'xlsx'"
src="/assets/images/xlsx.svg" />
<img class="chat-doc cursor-pointer"
[title]="message?.fileName"
(click)="openDocument(message?.imageUrl)"
*ngIf="message?.messageType === 'docx'"
src="/assets/images/docx.svg" />
<img class="chat-doc cursor-pointer"
[title]="message?.fileName"
(click)="openDocument(message?.imageUrl)"
*ngIf="message?.messageType === 'pptx'"
src="/assets/images/pptx-file.svg" />
<img class="chat-doc cursor-pointer"
[title]="message?.fileName"
(click)="openDocument(message?.imageUrl)"
*ngIf="message?.messageType !== 'Text' &&
message?.messageType !== 'Image' &&
message?.messageType !== 'xlsx' &&
message?.messageType !== 'csv'
&& message?.messageType !== 'pdf' &&
message?.messageType !== 'doc'
&& message?.messageType !== 'docx'
&& message?.messageType !== 'pptx'"
src="/assets/images/document.svg" />
</p>
</div>
</div>
Use ng generate pipe pipe name
detect-urls.pipe.ts
The fusion of these two technologies has unlocked a realm of possibilities, making it easier than ever to create responsive, real-time, and scalable web applications. Whether you're building an e-commerce platform, a social network, or any other app, Angular and Firebase have your back. Keep the user experience at the heart of your development, and you're sure to achieve remarkable results.
Ready to harness the power of Angular and Firebase for your next project? Hire our AngularJs Developers, and let them build efficient, real-time web applications with the perfect blend of Angular and Firebase.