BPB Online LLP
Object Oriented Programming with Angular
Object Oriented Programming with Angular
US$ 19.95
The publisher has enabled DRM protection, which means that you need to use the BookFusion iOS, Android or Web app to read this eBook. This eBook cannot be used outside of the BookFusion platform.
Description
Contents
Reviews

Learn advanced techniques and best practices of Angular programming for building enterprise web applications

Key Features
Get familiar with the core concepts of Angular.
Discover best practices, tips, and tricks while working with Angular.
Learn how to architect data driven web applications.
Explore methods to pass data between components in Angular.
Learn how to deploy and secure your Angular application.

Description
Angular is a Single Page Application (SPA) development framework open-sourced by Google. The Angular framework is written in TypeScript language, which enables a web developer to write JavaScript code in Object-Oriented fashion. TypeScript makes it easier to build a client-side web application with classes, interfaces, generics, inheritance, and other Object-Oriented features. TypeScript compiler takes care of transpiling these features into native JavaScript. Angular is a framework that comes with Dependency Injection, HTTP communication, Forms, and other features out of the box.

This book will leverage on your prior programming knowledge to learn Angular. Microsoft .Net stack, C#, Windows Forms, WPF, ASP.NET have been widely used for developing desktop and web applications. We shall be referring to concepts from these technologies with Angular whenever applicable, thus having prior experience would be a great advantage. This book takes you from the basics of TypeScript language to building modular and robust enterprise web applications and deployment.

What you will learn
Learn how to orchestrate complex Angular applications.
Get to know more about Dependency Injection in depth.
Learn how to build template and dynamic forms in Angular.
Learn how to use Angular routes in an application.
Learn how to communicate with backend services using HTTP.

Who this book is for
This book is for readers who want to learn Angular. Having a basic Object-Oriented programming knowledge, programming experience with C#.Net/Java, and hands-on web development experience would be an added advantage.

Table of Contents
1. Typescript – the underdog
2. Hello, Angular!
3. Building small and simple
4. Data Binding and Pipes
5. NgModule - in depth
6. Dependency Injection and Services
7. Building forms
8. Communication within Components
9. Consuming HTTP Resources
10. Routing Angular application
11. Deployment and tools

About the Author
Balram Chavan is a software professional having 11+ years of relevant experience working in cross domains. He has been awarded with GitHub Developer Program Membership for his contribution to open source world. He also contributes to multiple technology blogs and forums. Balram has also published many npm.js packages for Angular framework.

LinkedIn Profile: https://www.linkedin.com/in/balram-chavan/

Language
English
ISBN
9789389328363
Cover Page
Title Page
Copyright Page
Dedication Page
About the Author
About the Reviewer
Acknowledgement
Preface
Errata
Table of Contents
Learning Angular in Object-Oriented Way
1. Typescript – The Underdog
Introduction
Structure
Objective
Basic Data Types
Number
Boolean
String
Array
Tuple
Enum
Any
Object
void
null and undefined
never
Variable Declaration
Let
Var
Const
Declare
Functions
Regular Function
Anonymous Function
Arrow Function
Classes and Interfaces
Inheritance
Interface
Type Conversion
Union Types
Generics
Decorators
Modules and Namespaces
Advanced Types and Other Keywords
Static
readonly and const
String and Number Literal Types
Type Aliases
Summary
Questions
2. Hello Angular!
Structure
Objective
History of AngularJS to Angular
Setup
Node.js
Angular CLI
Creating a New Project
Changing Default Port
Live Reload
Project Structure
README.md
angular.json
e2e Folder
package.json
package-lock.json
src Folder
Application Workflow
IDE for Angular
Conclusion
Questions
3. Building Small and Simple
Introduction
Structure
Objective
Project Setup
Introduction to @NgModule
What is @NgModule?
Inspecting @NgModule metadata object
Introduction to @Component
What is @Component?
Inspecting @Component Metadata
Introduction to Basic Data Bindings
Types of Data Bindings
Introduction to NgIf, NgFor, and ngForm directives
What is NgIf?
What is NgFor?
What is ngForm?
Building Party-Invite Sign-up form
Production Deployment
Angular Lifecycle Events
Debugging Angular Application
Conclusion
Questions
4. Data Binding and Pipes
Structure
Objective
Introduction to Data Binding
One-way Data Binding – Interpolation – Data Source to View
One-way Data Binding – Event Binding – View to Data Source
HTML Element Data Binding – Local Reference
Two-way Data Binding
HTML Element’s Property Binding
Attribute Data Binding
CSS Class Data Binding
Style Binding
NgClass Binding
Introduction to Pipes
Generating Custom Pipe
Passing Parameters to Pipe
Pure and Impure Pipes
List of Built-in Pipes
Conclusion
Questions
5. @NgModule()
Structure
Objective
@NgModule() versus C# Namespace
Angular Application with @NgModule()
FinanceModule Example
Mapping Namespace of C# with @NgModule() of Angular
@NgModule() Decorator
TypeScript Modules versus @NgModule()
Types of @NgModule()
Eagerly Loaded @NgModule()
Lazy Loaded @NgModule()
Commonly Used @NgModule()
Hands-on
Identifying Different Types of Modules
Introduction to Angular Ivy
Conclusion
Questions
6. Dependency Injection (DI) and Services
Structure
Objective
Introduction to Dependency Injection
Problem Statement with an Example
Solution with Dependency Injection
Dependency Injection in C#
Dependency Injection in Java Spring Framework
Dependency Injection in Angular
Introduction to Angular Services
Automobile application example
Summary
Service Lifetime and Scope
Injector graph
Summary
Injecting Service into Another Service
Mock Services for Faster UI Development
Summary
ElementInjector – Providing Service into Component
Summary
Different Types of Providers
The Provider with “useValue”
C# Analogy
The Provider with “useClass”
C# Analogy
The Provider with “useFactory”
Summary
Organizing services
Conclusion
Questions
7. Building Forms
Structure
Objective
HTML Forms
ASP.NET Forms
AngularJS Forms
Angular Forms
Template-driven Forms
Template-driven Form Validations
Template-driven form Custom Validations
Reactive Forms
Reactive Form Validations
Reactive Form Custom Validator
Template-driven Forms versus Reactive Forms
Conclusion
Questions
8. Communication Between Components
Structure
Objective
C# Windows Form Communications
Parent-Child Communication Using @Input() and @Output()
Parent-Child communication through a local variable reference
Parent-Child communication through @ViewChild() decorator
Passing Data between Components through Service
Passing Data between Components through LocalStorage
Conclusion
Questions
9. Being Alive By Consuming HTTP Resources
Structure
Objective
Introduction to HTTP Methods
Fetch Posts through the GET Method
Using async/await for Blocking the GET Method
Delegate HTTP Operations to Angular Service
Create a New Post Using the POST Method
Update post through PUT method
Delete post through DELETE method
Handling HTTP Errors
Retry HTTP Operation
Passing Parameters in HTTP Requests
Passing HTTP Headers
Organizing server URLs
Switching Between Mock and Real Data Service
Introduction to HTTP Interceptors
Conclusion
Questions
10. Routing in Angular
Introduction
Structure
Objective
What and Why Angular Routing?
Overview of Angular Routing
Building E-commerce Web Application With Routing
Adding Angular Material Design Library
Create Feature Modules with Routes
Login Page with Route
Sign-up Page with Route
Navigating to Routes through the Link
Set the Default Route of the Application
Custom 404 Page-Not-Found page
Route Configuration Ordering
Navigate to Route through Code
Create Child Routes
Enable Debug Trace for Route Configuration
Routing Life Cycle Events
Passing Route Parameter
Passing Data between Routes
Securing a Route Path
CanDeactivate Guard
Prefetching Product Details
Asynchronous Routes
Generating Child Asynchronous Routes through CLI
Inspect Router Tree in Augury
Module Preloading Strategy
Conclusion
Questions
11. Deployment and Best Practices
Introduction
Structure
Objective
Deployment
ng build – Simple Deployment
Production Build
Change dist Folder Path
ng deploy Command
Different Build Configurations
JIT and AOT Compilation
Cross-Origin Resource Sharing (CORS)
ng lint Command
Unit Testing Overview
Code Coverage Report
Performance and Optimization
Polyfills – Older Browser Support
Web Workers
Conclusion
Questions
The book hasn't received reviews yet.