Submit Search
Upload
Angular JS2 Training Session #3
•
0 likes
•
80 views
P
Paras Mendiratta
Follow
Designing Single page application using Angular JS 2 - Part 3
Read less
Read more
Software
Report
Share
Report
Share
1 of 29
Download now
Download to read offline
Recommended
Infrastructure as-code-guide-en-v6 299129
Infrastructure as-code-guide-en-v6 299129
Ai K
Ignite Talk on Chef
Ignite Talk on Chef
Bob Nowadly
Intermediate/Compliance training Guide
Intermediate/Compliance training Guide
Chef
A Series of Fortunate Events: Building an Operator in Java
A Series of Fortunate Events: Building an Operator in Java
VMware Tanzu
London Community Summit - Chef at SkyBet
London Community Summit - Chef at SkyBet
Chef
London Community Summit 2016 - Fresh New Chef Stuff
London Community Summit 2016 - Fresh New Chef Stuff
Chef
Infrastructure Automation with Chef
Infrastructure Automation with Chef
REAN Cloud
Compliance Automation with Inspec Part 2
Compliance Automation with Inspec Part 2
Chef
Recommended
Infrastructure as-code-guide-en-v6 299129
Infrastructure as-code-guide-en-v6 299129
Ai K
Ignite Talk on Chef
Ignite Talk on Chef
Bob Nowadly
Intermediate/Compliance training Guide
Intermediate/Compliance training Guide
Chef
A Series of Fortunate Events: Building an Operator in Java
A Series of Fortunate Events: Building an Operator in Java
VMware Tanzu
London Community Summit - Chef at SkyBet
London Community Summit - Chef at SkyBet
Chef
London Community Summit 2016 - Fresh New Chef Stuff
London Community Summit 2016 - Fresh New Chef Stuff
Chef
Infrastructure Automation with Chef
Infrastructure Automation with Chef
REAN Cloud
Compliance Automation with Inspec Part 2
Compliance Automation with Inspec Part 2
Chef
Behind the scenes of Scaleway Functions : when Kubernetes meets our products
Behind the scenes of Scaleway Functions : when Kubernetes meets our products
Scaleway
Chef Cookbook Workflow
Chef Cookbook Workflow
Amazon Web Services
Compliance Automation Workshop
Compliance Automation Workshop
Chef
Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1
Toshiaki Maki
Nike popup compliance workshop
Nike popup compliance workshop
Chef
Chef Automate Workflow Demo
Chef Automate Workflow Demo
Chef
Chef for beginners module 1
Chef for beginners module 1
Chef
IT Automation with Chef
IT Automation with Chef
Anuchit Chalothorn
Azure handsonlab
Azure handsonlab
Chef
Automating Infrastructure with Chef
Automating Infrastructure with Chef
Jennifer Davis
Chef compliance - Intermediate Training
Chef compliance - Intermediate Training
Sarah Hynes Cheney
Advanced Spring Boot with Consul
Advanced Spring Boot with Consul
VMware Tanzu
Achieving DevOps Success with Chef Automate
Achieving DevOps Success with Chef Automate
Chef
Service Configuration Management for Rapid Growth - demo 10 steps to build pi...
Service Configuration Management for Rapid Growth - demo 10 steps to build pi...
Takashi Someda
Testing in Ballerina Language
Testing in Ballerina Language
Lynn Langit
How to Write Chef Cookbook
How to Write Chef Cookbook
devopsjourney
Pyramid deployment
Pyramid deployment
Carlos de la Guardia
Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4
Chef
Silicon Valley Code Camp 2019 - Reaching the Cloud Native World
Silicon Valley Code Camp 2019 - Reaching the Cloud Native World
Chris Bailey
BOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyo
Toshiaki Maki
Angular 4 with firebase
Angular 4 with firebase
Anne Bougie
How to build RESTful API in 15 Minutes.pptx
How to build RESTful API in 15 Minutes.pptx
Linx
More Related Content
What's hot
Behind the scenes of Scaleway Functions : when Kubernetes meets our products
Behind the scenes of Scaleway Functions : when Kubernetes meets our products
Scaleway
Chef Cookbook Workflow
Chef Cookbook Workflow
Amazon Web Services
Compliance Automation Workshop
Compliance Automation Workshop
Chef
Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1
Toshiaki Maki
Nike popup compliance workshop
Nike popup compliance workshop
Chef
Chef Automate Workflow Demo
Chef Automate Workflow Demo
Chef
Chef for beginners module 1
Chef for beginners module 1
Chef
IT Automation with Chef
IT Automation with Chef
Anuchit Chalothorn
Azure handsonlab
Azure handsonlab
Chef
Automating Infrastructure with Chef
Automating Infrastructure with Chef
Jennifer Davis
Chef compliance - Intermediate Training
Chef compliance - Intermediate Training
Sarah Hynes Cheney
Advanced Spring Boot with Consul
Advanced Spring Boot with Consul
VMware Tanzu
Achieving DevOps Success with Chef Automate
Achieving DevOps Success with Chef Automate
Chef
Service Configuration Management for Rapid Growth - demo 10 steps to build pi...
Service Configuration Management for Rapid Growth - demo 10 steps to build pi...
Takashi Someda
Testing in Ballerina Language
Testing in Ballerina Language
Lynn Langit
How to Write Chef Cookbook
How to Write Chef Cookbook
devopsjourney
Pyramid deployment
Pyramid deployment
Carlos de la Guardia
Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4
Chef
Silicon Valley Code Camp 2019 - Reaching the Cloud Native World
Silicon Valley Code Camp 2019 - Reaching the Cloud Native World
Chris Bailey
BOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyo
Toshiaki Maki
What's hot
(20)
Behind the scenes of Scaleway Functions : when Kubernetes meets our products
Behind the scenes of Scaleway Functions : when Kubernetes meets our products
Chef Cookbook Workflow
Chef Cookbook Workflow
Compliance Automation Workshop
Compliance Automation Workshop
Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1
Nike popup compliance workshop
Nike popup compliance workshop
Chef Automate Workflow Demo
Chef Automate Workflow Demo
Chef for beginners module 1
Chef for beginners module 1
IT Automation with Chef
IT Automation with Chef
Azure handsonlab
Azure handsonlab
Automating Infrastructure with Chef
Automating Infrastructure with Chef
Chef compliance - Intermediate Training
Chef compliance - Intermediate Training
Advanced Spring Boot with Consul
Advanced Spring Boot with Consul
Achieving DevOps Success with Chef Automate
Achieving DevOps Success with Chef Automate
Service Configuration Management for Rapid Growth - demo 10 steps to build pi...
Service Configuration Management for Rapid Growth - demo 10 steps to build pi...
Testing in Ballerina Language
Testing in Ballerina Language
How to Write Chef Cookbook
How to Write Chef Cookbook
Pyramid deployment
Pyramid deployment
Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4
Silicon Valley Code Camp 2019 - Reaching the Cloud Native World
Silicon Valley Code Camp 2019 - Reaching the Cloud Native World
BOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyo
Similar to Angular JS2 Training Session #3
Angular 4 with firebase
Angular 4 with firebase
Anne Bougie
How to build RESTful API in 15 Minutes.pptx
How to build RESTful API in 15 Minutes.pptx
Linx
ASP.NET Core Web API documentation web application
ASP.NET Core Web API documentation web application
AMARAAHMED7
Firebase with Android
Firebase with Android
Fumihiko Shiroyama
Introduction to Firebase on Android
Introduction to Firebase on Android
amsanjeev
Serverless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applications
Loiane Groner
Full Angular 7 Firebase Authentication System
Full Angular 7 Firebase Authentication System
Digamber Singh
Email authentication using firebase auth + flutter
Email authentication using firebase auth + flutter
Katy Slemon
Firebase
Firebase
Tejas Koundinya
Building with Firebase
Building with Firebase
Mike Fowler
Multi Client Development with Spring
Multi Client Development with Spring
Joshua Long
Using Java to interact with Firebase in Android
Using Java to interact with Firebase in Android
Magda Miu
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
Mario Cardinal
O365 DEVCamp Los Angeles June 16, 2015 Module 06 Hook into SharePoint APIs wi...
O365 DEVCamp Los Angeles June 16, 2015 Module 06 Hook into SharePoint APIs wi...
Ivan Sanders
Firebase
Firebase
Naveen Kumar Neelam
Firebase overview
Firebase overview
Maksym Davydov
Introduction to Google App Engine
Introduction to Google App Engine
Kanda Runapongsa Saikaew
Lecture 11 Firebase overview
Lecture 11 Firebase overview
Maksym Davydov
Apresentação firebase
Apresentação firebase
Diego Figueredo
Apache Aries Blog Sample
Apache Aries Blog Sample
Skills Matter
Similar to Angular JS2 Training Session #3
(20)
Angular 4 with firebase
Angular 4 with firebase
How to build RESTful API in 15 Minutes.pptx
How to build RESTful API in 15 Minutes.pptx
ASP.NET Core Web API documentation web application
ASP.NET Core Web API documentation web application
Firebase with Android
Firebase with Android
Introduction to Firebase on Android
Introduction to Firebase on Android
Serverless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applications
Full Angular 7 Firebase Authentication System
Full Angular 7 Firebase Authentication System
Email authentication using firebase auth + flutter
Email authentication using firebase auth + flutter
Firebase
Firebase
Building with Firebase
Building with Firebase
Multi Client Development with Spring
Multi Client Development with Spring
Using Java to interact with Firebase in Android
Using Java to interact with Firebase in Android
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
O365 DEVCamp Los Angeles June 16, 2015 Module 06 Hook into SharePoint APIs wi...
O365 DEVCamp Los Angeles June 16, 2015 Module 06 Hook into SharePoint APIs wi...
Firebase
Firebase
Firebase overview
Firebase overview
Introduction to Google App Engine
Introduction to Google App Engine
Lecture 11 Firebase overview
Lecture 11 Firebase overview
Apresentação firebase
Apresentação firebase
Apache Aries Blog Sample
Apache Aries Blog Sample
Recently uploaded
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
naitiksharma1124
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
steffenkarlsson2
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Lisi Hocke
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio, Inc.
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Gáspár Nagy
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Marc Lester
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
Andrea Goulet
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
Mehmet Akar
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Neo4j
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeCon
Natan Silnitsky
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
Shane Coughlan
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Era
confluent
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
SelfMade bd
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
Inflectra
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
Prakhyath Rai
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
ICS
^Clinic ^%[+27788225528*Abortion Pills For Sale In harare
^Clinic ^%[+27788225528*Abortion Pills For Sale In harare
kasambamuno
What is a Recruitment Management Software?
What is a Recruitment Management Software?
NYGGS Automation Suite
Abortion Clinic In Polokwane ](+27832195400*)[ 🏥 Safe Abortion Pills in Polok...
Abortion Clinic In Polokwane ](+27832195400*)[ 🏥 Safe Abortion Pills in Polok...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
Recently uploaded
(20)
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeCon
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Era
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
^Clinic ^%[+27788225528*Abortion Pills For Sale In harare
^Clinic ^%[+27788225528*Abortion Pills For Sale In harare
What is a Recruitment Management Software?
What is a Recruitment Management Software?
Abortion Clinic In Polokwane ](+27832195400*)[ 🏥 Safe Abortion Pills in Polok...
Abortion Clinic In Polokwane ](+27832195400*)[ 🏥 Safe Abortion Pills in Polok...
Angular JS2 Training Session #3
1.
presented by Paras Mendiratta Session
3
2.
Topics for Today 1.
Connecting with Firebase 2. Consuming HTTP API 3. Authentication 4. Production Deployment 2 // Visit the site https://cookbook-a98ee.firebaseapp.com/signin
3.
1. Connecting With Firebase
4.
https://console.firebase.google.com
5.
6.
Database Rules
7.
Firebase Project Database URL Database
Node (JSON)
8.
Install Firebase Module //
3. Add Bootstrap Library npm install firebase
9.
2. Consuming HTTP API
10.
Data-Storage Service shared/data-storage.service.ts import {
Injectable } from ‘@angular/core'; import { Http, Response } from ‘@angular/http'; @Injectable() export class DataStorageService { constructor(private http: Http) { } }
11.
Save Recipes shared/data-storage.service.ts import {
Injectable } from ‘@angular/core'; import { Http, Response } from ‘@angular/http'; import { RecipeService } from ‘app/recipes/recipe.service’; @Injectable() export class DataStorageService { private let recipeDBURL = ‘https://cookbook-a98ee.firebaseio.com/recipes.json’; constructor(private http: Http, private recipeService: RecipeService) { } storeRecipes() { return this.http.put(this.recipeDBURL, this.recipeService.getRecipes()); } }
12.
Fetch Recipes shared/data-storage.service.ts import {
Recipe } from ‘app/recipes/recipe.model’; @Injectable() export class DataStorageService { storeRecipes() { this.http.get(this.recipeDBURL) .map((response: Response) => { const recipes: Recipe[] = response.json(); for (let recipe of recipes) { recipe.ingredients = recipe.ingredients? recipe.ingredients : []; } }) .subscribe((recipes: Recipe[]) => { this.recipeService.setRecipes(recipes); }); } }
13.
3. Authentication
14.
15.
Initialize Firebase app.component.ts File: import
* as firebase from ‘firebase’; export class AppComponent implements OnInit { ngOnInit(): void { firebase.initializeApp({ apiKey: ‘Your-API-Key’, authDomain: ‘Firebase-App-Domain’ }); } } 15
16.
Database Rules
17.
Signup Page
18.
Signup Form signup.component.html File: <div class="row"> <div class="col-xs-12 col-sm-10 col-md-8 col-sm-offset-1 col-md-offset-2"> <form (ngSubmit)="onSignup(f)" #f="ngForm"> <div class="form-group"> <label for="email">Mail</label> <input type="email" id="email" name="email" ngModel class="form-control"> </div> <div class="form-group"> <label for="password">Password</label> <input type="password" id="password" name="password" ngModel class="form-control"> </div> <button class="btn btn-primary" type="submit" [disabled]="!f.valid">Sign Up</button> </form> </div> </div> 18
19.
SignUp Service auth/auth.service.ts import {
Injectable } from ‘@angular/core'; import * as firebase from ‘firebase'; import { Router } from ‘@angular/router’; @Injectable() export class AuthService { constructor(private router: Router) { } signupUser(email: string, password: string) { firebase.auth().createUserWithEmailAndPassword(email, password) .then(response => { this.router.navigate([‘/’]); }) .catch(error => { console.log(‘Sign up Error: ’, error); }) } }
20.
SignIn Page
21.
SignIn Form signup.component.html File: <div class="row"> <div class="col-xs-12 col-sm-10 col-md-8 col-sm-offset-1 col-md-offset-2"> <form (ngSubmit)="onSignin(f)" #f="ngForm"> <div class="form-group"> <label for="email">Mail</label> <input type="email" id="email" name="email" ngModel class="form-control"> </div> <div class="form-group"> <label for="password">Password</label> <input type="password" id="password" name="password" ngModel class="form-control"> </div> <button class="btn btn-primary" type="submit" [disabled]="!f.valid">Sign In</button> </form> </div> </div> 21
22.
SignIn Service auth/auth.service.ts export class
AuthService { token: string; signInUser(email: string, password: string) { firebase.auth().signInWithEmailAndPassword(email, password) .then(response => { this.router.navigate([‘/’]); firebase.auth().currentUser.getToken().then((token: string) => { this.token = token; }) }) .catch(error => { console.log(‘Sign up Error: ’, error); }) } }
23.
Authentication auth/auth.service.ts export class AuthService
{ getToken() { firebase.auth().currentUser.getToken() .then(token => { this.token = token; }); return this.token; } isAuthenticated() { return this.token != null; } logout() { firebase.auth().signOut(); this.token = null; } }
24.
Securing Routes auth/auth-guard.service.ts import { Injectable } from '@angular/core'; import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from "@angula r/router"; import { Observable } from "rxjs/Observable"; import { AuthService } from "app/auth/auth.service"; @Injectable() export class AuthGuardService implements CanActivate { constructor(private authSevice:AuthService) { } canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | Observable<boolean> | Promise<boolean> { return this.authSevice.isAuthenticated(); } }
25.
Securing Routes app-routing.module.ts const appRoutes: Routes = [ { path: '', redirectTo: '/recipes', pathMatch: 'full' }, { path: 'recipes', component: RecipesComponent, children: [ { path: '', component: RecipeStartComponent }, { path: 'new', component: RecipeEditComponent, canActivate:[AuthGuardService] }, { path: ':id', component: RecipeDetailComponent }, { path: ':id/edit', component: RecipeEditComponent, canActivate:[AuthGuardService] } ] }, { path: 'shopping-list', component: ShoppingListComponent }, { path: 'signup', component: SignupComponent }, { path: 'signin', component: SigninComponent } ];
26.
4. Production Deployment
27.
Firebase Deployment // 1.
Install Firebase CLI tool npm install -g firebase-tools // 2. Build the production files ng build ——prod // 3. Firebase Login firebase login // 4. Firebase Init firebase init
28.
// 5. Select
Destination Directory /dist // 6. Deploy Site firebase deploy
29.
Thank You
Download now