17.10.2018 Views

Angular

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 20: Lifecycle Hooks ................................................................................................................................. 91<br />

Section 20.1: OnChanges ............................................................................................................................................ 91<br />

Section 20.2: OnInit ..................................................................................................................................................... 91<br />

Section 20.3: OnDestroy ............................................................................................................................................. 91<br />

Section 20.4: AfterContentInit .................................................................................................................................... 92<br />

Section 20.5: AfterContentChecked .......................................................................................................................... 92<br />

Section 20.6: AfterViewInit .......................................................................................................................................... 92<br />

Section 20.7: AfterViewChecked ................................................................................................................................ 93<br />

Section 20.8: DoCheck ................................................................................................................................................ 93<br />

Chapter 21: <strong>Angular</strong> RXJS Subjects and Observables with API requests ....................................... 95<br />

Section 21.1: Wait for multiple requests ..................................................................................................................... 95<br />

Section 21.2: Basic request ......................................................................................................................................... 95<br />

Section 21.3: Encapsulating API requests .................................................................................................................. 95<br />

Chapter 22: Zone.js .................................................................................................................................................... 97<br />

Section 22.1: Getting reference to NgZone ............................................................................................................... 97<br />

Section 22.2: Using NgZone to do multiple HTTP requests before showing the data ........................................ 97<br />

Chapter 23: Services and Dependency Injection ........................................................................................ 98<br />

Section 23.1: Example service ..................................................................................................................................... 98<br />

Section 23.2: Example with Promise.resolve ............................................................................................................. 99<br />

Section 23.3: Testing a Service ................................................................................................................................ 100<br />

Chapter 24: <strong>Angular</strong> 2 Forms Update ............................................................................................................ 103<br />

Section 24.1: <strong>Angular</strong> 2 : Template Driven Forms .................................................................................................. 103<br />

Section 24.2: <strong>Angular</strong> 2 Form - Custom Email/Password Validation .................................................................. 103<br />

Section 24.3: Simple Password Change Form with Multi Control Validation ...................................................... 105<br />

Section 24.4: <strong>Angular</strong> 2 Forms ( Reactive Forms ) with registration form and confirm password validation<br />

............................................................................................................................................................................. 106<br />

Section 24.5: <strong>Angular</strong> 2: Reactive Forms (a.k.a Model-driven Forms) ................................................................. 108<br />

Section 24.6: <strong>Angular</strong> 2 - Form Builder ................................................................................................................... 109<br />

Chapter 25: Detecting resize events .............................................................................................................. 111<br />

Section 25.1: A component listening in on the window resize event .................................................................... 111<br />

Chapter 26: Testing ngModel ............................................................................................................................. 112<br />

Section 26.1: Basic test .............................................................................................................................................. 112<br />

Chapter 27: Feature Modules ............................................................................................................................. 114<br />

Section 27.1: A Feature Module ................................................................................................................................ 114<br />

Chapter 28: Bootstrap Empty module in angular 2 ............................................................................... 115<br />

Section 28.1: An empty module ................................................................................................................................ 115<br />

Section 28.2: Application Root Module ................................................................................................................... 115<br />

Section 28.3: Bootstrapping your module .............................................................................................................. 115<br />

Section 28.4: A module with networking on the web browser ............................................................................. 115<br />

Section 28.5: Static bootstrapping with factory classes ....................................................................................... 116<br />

Chapter 29: Lazy loading a module ................................................................................................................ 117<br />

Section 29.1: Lazy loading example ........................................................................................................................ 117<br />

Chapter 30: Advanced Component Examples ........................................................................................... 119<br />

Section 30.1: Image Picker with Preview ................................................................................................................. 119<br />

Section 30.2: Filter out table values by the input ................................................................................................... 120<br />

Chapter 31: Bypassing Sanitizing for trusted values .............................................................................. 122<br />

Section 31.1: Bypassing Sanitizing with pipes (for code re-use) ........................................................................... 122<br />

Chapter 32: <strong>Angular</strong> 2 Data Driven Forms ................................................................................................... 125

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!