CHAPTER 1. Setup Requirements
Scaffolding Our Project
Generating New Angular App with CLI
ng new lovely-offline --routing --style=scss
Adding Angular Material Design
npm install --save @angular/material @angular/cdk @angular/animations
@import "~@angular/material/prebuilt-themes/indigo-pink.css";
Setting Up a Mobile Device
CHAPTER 2. Deploying to Firebase as the Back End
Deploying to Firebase
Generating a New Angular App
ng build --prod
npm install -g firebase-tools
firebase login
Initializing the App
firebase init
Deploying Our App
firebase deploy
Setting Up AngularFire
npm install firebase @angular/fire --save
import { Component } from '@angular/core';
import { AngularFirestore } from 'angularfire2/firestore';
import { Observable } from 'rxjs';
@Component({
selector: 'app-root',
template: `
<h1>Bind Firestore collection example</h1>
<ul>
<li class="text" *ngFor="let note of notes$ | async">
{{note.title}}
</li>
</ul>
<router-outlet></router-outlet>
`,
styleUrls: ['./app.component.scss']
})
export class AppComponent {
notes$: Observable<any[]>;
constructor(db: AngularFirestore) {
this.notes$ = db.collection('notes').valueChanges();
}
}
CHAPTER 3. Completing an Angular App
- Firebase Web Codelab
-
https://codelabs.developers.google.com/codelabs/firebase-web/#0
- Ionic - Publishing PWA
-
https://ionicframework.com/docs/publishing/progressive-web-app
ng add @angular/material
Creating a Core Module / Shared Module
ng generate module modules/core
ng generate module modules/shared
Header, Footer, and Body Components
ng g m modules/layout
ng generate component modules/layout/header
ng generate component modules/layout/footer
- src/app/modules/layout/header - header.component.html - header.component.scss - header.component.ts - src/app/modules/layout/footer - footer.component.html - footer.component.scss - footer.component.ts - src - styles.scss
src/app/app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<div class="appress-pwa-note">
<app-header></app-header>
<div class="main">
<router-outlet></router-outlet>
</div>
<app-footer></app-footer>
</div>
`,
})
export class AppComponent { }
Login / Profile Page
ng generate module modules/user --routing
ng generate component modules/user/userContainer --flat
- UserRoutingModule - AppRoutingModule
Adding Login, Signup, and Profile UI and Functionalities
ng generate service modules/core/firebaseAuth
- src/app/modules/core/ - firebase-auth.service.ts - src/app/modules/user/ - user-container.component.ts - user-container.component.html - user-container.component.scss
Firebase CRUD Operations for Note Module
List, Add, and Detail Note Views
ng generate module modules/notes --routing
ng generate component modules/notes/notesList
ng generate component modules/notes/notesAdd
ng generate component modules/notes/noteDetails
Authentication Service
ng generate service modules/core/auth