5 Cool New Features in AngularFire

Fireship · Intermediate ·📰 AI News & Updates ·7y ago

Key Takeaways

The video discusses five new features in AngularFire 5.2, including Schematics, Perf, ID Field, Collection Group Query, and AngularFire Auth Guard Module, which simplify and extend the functionality of Angular Firebase projects.

Full Transcript

over the last few weeks we've seen major new releases for both angular and firebase and that has resulted in angularfire version 5.2 and it contains a whole bunch of new features that you may have not been expecting in today's video we'll look at five brand new features in angular fire and how they can help simplify your angular firebase project if you're new here like and subscribe and you can find the full write-up on fire ship IO the first new feature you should be aware of are the new schematics that make it easy to add angular fire to an existing project and then deploy it to firebase hosting all we have to do is run ng add angular fire and then select a corresponding firebase project that will install the necessary dependencies and also initialize firebase in this project and another cool thing is that it hooks into the new builder API at angular 8 which allows us to run a command to deploy this project to firebase hosting in other words you can go from zero to a deployed app with just two commands the next new feature you should be aware of is the integration of firebase performance I already have an entire video on this topic and adding firebase perf to your project is pretty much a no-brainer but angular fire is not just a wrapper for performance it extends it with additional functionality specifically for rxjs you can get basic performance reporting with a single line of code or you can use one of the custom rxjs operators to run a manual trace this makes it really easy to measure the performance of things like HTTP calls because all you have to do is pipe in this custom operator and everything else happens for you automatically the third new feature is my favorite and that's because I wrote the code for it and it's just a new option on value changes when listening to the value of a document or collection the option is called ID field and it allows you to return the document ID in addition to the document data when working with firestore you often need the document data to show in the UI and then you need the ID itself to make updates or rights to the database but combining the document ID with the data is an overly complex process in my opinion value changes returns an observable that emits a JavaScript object or an array of objects the ID field argument is optional and it will return the document ID map to a specific property on the object so this allows you to specify the property name for the ID so you don't accidentally overwrite some underlying data that's already on the document so the end result is less complexity and fewer lines of code in your front-end applications now the next feature that we'll look at is the collection group query which is new and firebase version six this feature is also covered in detail in its own video but it's something you should definitely be aware of because it adds a ton of flexibility to data modeling and firestore in angular fire the usage looks like this where we have a reference to a collection group that will group all the collections in the database with that same name making it possible to run queries across all the data contained in all the sub collections with that same name now I save the best for last and that is the angular fire auth card module if you've ever built something like role based authorization in an angular firebase app there's a good chance that you have a lot of complex code living in your router guards apps that have a lot of custom authorization logic typically need to lock down specific routes based on a user's role or authorization level the most simple use case is when you want to lock down a route based on whether or not a user is logged in we can now easily handle that logic by simply dropping in the angularfire auth guards you can activate on the routes that we want to apply it to but what if we want to redirect the user to the login page if this guard results to false the guard module provides they can activate helper method that allows us to pass in a custom rxjs operator and there's a bunch of built-in operators for the most common situations like redirecting an unauthorized user to a different route and you can even do the opposite of redirecting a logged in user to a new route and if the built-in functions aren't enough for you you can actually build your own because they're just custom rxjs operators under the hood and a custom rxjs operator is just a JavaScript function we'll go ahead and create our own auth pipe which is a function that should return an observable of a boolean or an array of strings if we want to redirect the user to a new route we can easily do this by using the rxjs map operator and its callback function will give us access to the firebase user which we can use to determine whether or not this user is authorized to visit this route for the Jeff guard we're going to make sure that the users display name contains the substring of Jeff and now we can use this logic by simply combining it with the can activate helper so over all the auth guard module provides a much simpler and concise way to write authorization logic with the angular router in most cases all the hard work will be done for you but if you want to implement your own custom logic it's just a matter of writing a function over all angular version 5.2 adds a ton of new functionality and does a lot of things to help simplify your code I'm gonna go ahead and wrap things up there if this video helped you please I can subscribe and consider becoming a pro member at fire ship IO to get access to even more content thanks for watching and I will talk to you soon [Music]

Original Description

With the releases of Angular 8 and Firebase 6 comes a bunch of new features in AngularFire that can extend and simplify your code https://fireship.io Official Docs: https://github.com/angular/angularfire2 1. Schematics 2. Perf https://youtu.be/KYYjdWSrRjI 3. ID Field 4. Collection Group Query https://youtu.be/fQ4u1J717ys 5. Router Guards #angular #firebase Download the quiz app 🤓 iOS https://itunes.apple.com/us/app/fireship/id1462592372?mt=8 Android https://play.google.com/store/apps/details?id=io.fireship.quizapp Upgrade to Fireship PRO at https://fireship.io/pro Use code lORhwXd2 for 25% off your first payment.
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Fireship · Fireship · 0 of 60

← Previous Next →
1 Angular 4 Development and Production Environments with Firebase
Angular 4 Development and Production Environments with Firebase
Fireship
2 OAuth with Angular and Firebase Tutorial
OAuth with Angular and Firebase Tutorial
Fireship
3 Anonymous Authentication with Angular and Firebase - Lazy Registration
Anonymous Authentication with Angular and Firebase - Lazy Registration
Fireship
4 Angular Router Guards for Firebase Users
Angular Router Guards for Firebase Users
Fireship
5 Angular Firebase CRUD App with NoSQL Database Tutorial
Angular Firebase CRUD App with NoSQL Database Tutorial
Fireship
6 Upload Files from Angular to Firebase Storage
Upload Files from Angular to Firebase Storage
Fireship
7 How to Deploy an Angular App to Firebase Hosting
How to Deploy an Angular App to Firebase Hosting
Fireship
8 Sharing Data between Components in Angular
Sharing Data between Components in Angular
Fireship
9 Loading Spinners for Asynchronous Firebase Data
Loading Spinners for Asynchronous Firebase Data
Fireship
10 Angular 4 Transactional Email with Google Firebase Cloud Functions
Angular 4 Transactional Email with Google Firebase Cloud Functions
Fireship
11 Firebase Database Rules Tutorial
Firebase Database Rules Tutorial
Fireship
12 Autocomplete Search with Angular4 and Firebase
Autocomplete Search with Angular4 and Firebase
Fireship
13 Reddit Inspired Upvoting System with Angular and Firebase NoSQL
Reddit Inspired Upvoting System with Angular and Firebase NoSQL
Fireship
14 Angular Drag-and-Drop File Uploads to Firebase Storage
Angular Drag-and-Drop File Uploads to Firebase Storage
Fireship
15 Text Translation with Firebase Cloud Functions onWrite and Angular 4
Text Translation with Firebase Cloud Functions onWrite and Angular 4
Fireship
16 Custom Usernames with Firebase Authentication
Custom Usernames with Firebase Authentication
Fireship
17 Twitter-Inspired Follow Unfollow Feature with Firebase and Angular 4
Twitter-Inspired Follow Unfollow Feature with Firebase and Angular 4
Fireship
18 Simple Pagination with Firebase and Angular 4
Simple Pagination with Firebase and Angular 4
Fireship
19 How to Connect Firebase Users to their Data - 3 Methods
How to Connect Firebase Users to their Data - 3 Methods
Fireship
20 Add Toast Message Notifications to your Angular App
Add Toast Message Notifications to your Angular App
Fireship
21 Facebook-Inspired Reactions System with Angular and Firebase
Facebook-Inspired Reactions System with Angular and Firebase
Fireship
22 Learn NgModule in Angular with Examples
Learn NgModule in Angular with Examples
Fireship
23 Lazy Loading Components in Angular 4
Lazy Loading Components in Angular 4
Fireship
24 Stripe Checkout Payments with Angular and Firebase - Part 1
Stripe Checkout Payments with Angular and Firebase - Part 1
Fireship
25 Process Stripe Payments with Firebase Cloud Functions - Part 2
Process Stripe Payments with Firebase Cloud Functions - Part 2
Fireship
26 Selling Digital Content in Angular with Stripe Payments - Part 3
Selling Digital Content in Angular with Stripe Payments - Part 3
Fireship
27 Angular 4 Full Text Search with Algolia - Part 1
Angular 4 Full Text Search with Algolia - Part 1
Fireship
28 Algolia with Firebase Cloud Functions - Part 2
Algolia with Firebase Cloud Functions - Part 2
Fireship
29 Firebase Phone Authentication in Angular 4
Firebase Phone Authentication in Angular 4
Fireship
30 Top 7 RxJS Concepts for Angular Developers
Top 7 RxJS Concepts for Angular Developers
Fireship
31 Learn Angular Animations with 5 Examples
Learn Angular Animations with 5 Examples
Fireship
32 Advanced Firebase Data Filtering (Multi-Property)
Advanced Firebase Data Filtering (Multi-Property)
Fireship
33 Realtime Maps with Mapbox + Firebase + Angular
Realtime Maps with Mapbox + Firebase + Angular
Fireship
34 Angular Reactive Forms with Firebase Database Backend
Angular Reactive Forms with Firebase Database Backend
Fireship
35 Send Push Notifications in Angular with Firebase Cloud Messaging
Send Push Notifications in Angular with Firebase Cloud Messaging
Fireship
36 Top 7 Ways to Debug Angular 4 Apps
Top 7 Ways to Debug Angular 4 Apps
Fireship
37 Infinite Scroll with Angular and Firebase
Infinite Scroll with Angular and Firebase
Fireship
38 Use TypeScript with Firebase Cloud Functions
Use TypeScript with Firebase Cloud Functions
Fireship
39 Realtime Graphs and Charts with Plotly and Firebase
Realtime Graphs and Charts with Plotly and Firebase
Fireship
40 Role-Based User Permissions in Firebase
Role-Based User Permissions in Firebase
Fireship
41 User Presence System in Realtime - Online, Offline, Away
User Presence System in Realtime - Online, Offline, Away
Fireship
42 Location-based Queries with GeoFire and Angular Google Maps
Location-based Queries with GeoFire and Angular Google Maps
Fireship
43 Angular ngrx Redux Quick Start Tutorial
Angular ngrx Redux Quick Start Tutorial
Fireship
44 Angular Ngrx Effects with Firebase Database
Angular Ngrx Effects with Firebase Database
Fireship
45 Progressive Web Apps with Angular
Progressive Web Apps with Angular
Fireship
46 Angular Ngrx with Firebase Google OAuth User Authentication
Angular Ngrx with Firebase Google OAuth User Authentication
Fireship
47 RxJS Quick Start with Practical Examples
RxJS Quick Start with Practical Examples
Fireship
48 Send SMS Text Messages with Twilio and Firebase
Send SMS Text Messages with Twilio and Firebase
Fireship
49 Firebase Database Performance Profiling
Firebase Database Performance Profiling
Fireship
50 Native Desktop Apps with Angular and Electron
Native Desktop Apps with Angular and Electron
Fireship
51 Subscription Payments with Stripe, Angular, and Firebase
Subscription Payments with Stripe, Angular, and Firebase
Fireship
52 Firestore with AngularFire5 Quick Start Tutorial
Firestore with AngularFire5 Quick Start Tutorial
Fireship
53 Angular HTTP Client Quick Start Tutorial
Angular HTTP Client Quick Start Tutorial
Fireship
54 Google Sign-In with Firestore Custom User Data
Google Sign-In with Firestore Custom User Data
Fireship
55 Star Review System from Scratch with Firestore + Angular
Star Review System from Scratch with Firestore + Angular
Fireship
56 Angular Chatbot with Dialogflow (API.ai)
Angular Chatbot with Dialogflow (API.ai)
Fireship
57 Learn @ngrx/entity and Feature Modules
Learn @ngrx/entity and Feature Modules
Fireship
58 Infinite Scroll Pagination with Firestore
Infinite Scroll Pagination with Firestore
Fireship
59 Faster Firestore via Data Aggregation
Faster Firestore via Data Aggregation
Fireship
60 Contentful - CMS for Angular Progressive Web Apps
Contentful - CMS for Angular Progressive Web Apps
Fireship

The video covers five new features in AngularFire 5.2, including Schematics, Perf, ID Field, Collection Group Query, and AngularFire Auth Guard Module, which simplify and extend the functionality of Angular Firebase projects. These features can help developers build more efficient and scalable applications.

Key Takeaways
  1. Run ng add angularfire to add AngularFire to an existing project
  2. Use the ID Field option to return the document ID when listening to the value of a document or collection
  3. Use the Collection Group Query to run queries across all sub-collections with the same name
  4. Implement the AngularFire Auth Guard Module to simplify authorization logic
  5. Use the canActivate helper method to pass in a custom RxJS operator
💡 The AngularFire Auth Guard Module provides a simpler and more concise way to write authorization logic with the Angular Router, making it easier to implement role-based authorization and other custom authorization logic.

Related Reads

📰
Broadcom extends its Apple chip work through 2031 in a fresh custom-silicon deal
Broadcom extends its custom-silicon deal with Apple through 2031, solidifying a key supplier relationship in consumer electronics
The Next Web AI
📰
How Nations Are Deploying AI for Strategic Priorities
Learn how nations are leveraging AI to drive strategic priorities and economic growth
NVIDIA AI Blog
📰
There Are Three Levels of Using AI. Most People Are Stuck on Level One.
Learn the three levels of using AI to improve output quality and move beyond basic usage
Medium · AI
📰
"AI Can’t Replace Humans" Might Be the Most Dangerous Career Advice of This Decade.
Relying on the idea that AI can't replace humans might be a career-threatening mindset, as it ignores the rapid advancements in automation and AI capabilities
Medium · AI
Up next
In the case of AI, leadership can create urgency but it simply cannot force adoption from a room
Steno
Watch →