Académique Documents
Professionnel Documents
Culture Documents
ngAfterContentInit Called after content (ng-content) has been projected into view
ngAfterContentChecked Called every time the projected content has been checked
ngAfterViewInit Called after the component’s view (and child views) has been initialized
ngAfterViewChecked Called every time the view (and child views) have been checked
Only affect/ change the element they Affect a whole area in the DOM
are added to (elements get added/ removed)
Services &
Dependency Injection
What are Services?
Application
Centralization
AppComponent LogService
AboutComponent UserComponent
Data Storage
log data to console store user data UserService
UserDetailComponent
Same Instance of Service is available for all Components (but not for
AppComponent
other Services)
Same Instance of Service is available for the Component and all its
Any other Component
child components
Pipes
Routing
Forms
Two Approaches
Template-Driven Reactive
Angular infers the Form Object from Form is created programmatically and
the DOM synchronized with the DOM
Http
Authentication
How does Authentication work?
Send Auth Set Session Identify via Send Auth Send Token
Information Cookie Cookie Information Authenticate
via Token
Module
Component
Component
Directive
Feature Modules
AppModule
Feature Module
AppComponent Component
Component Component
Directive Directive
Shared Modules
AppModule
FeatureModule1 FeatureModule2
Component Component
Component Component
Shared Module
Directive Directive
Modules and Routing (Lazy Loading)
AppModule
FeatureModule
Child Routes
Component
Directive
Why Modules?
Root Injector
AppModule
One Instance of LogService
providers: [LogService]
Modules and Service Injection
providers: [LogService]
Loaded at Application Launch: Loaded Lazily:
Provided on Root Level Provided on Module Level only
providers: [LogService]
Real Behavior:
Loaded at Application Launch:
Lazy Loaded Module uses Child Injector
Provided on Root Level
Shared Module
providers: [LogService]
Modules and Service Injection
providers: [LogService]
Don‘t provide Services in Shared Modules! Real Behavior:
Loaded at Application Launch:
Lazy Loaded Module uses Child Injector
Provided on Root Level
Especially not, if you plan to use them in Lazy Loaded
Modules!
Feature Module Lazy Loaded Feature Module
Shared Module
providers: [LogService]
Core Module
AppModule
Feature Module
AppComponent Component
Component Component
Core Module
Directive Directive
Ahead-of-Time Compilation
Development Development
Smaller File Size as unused Features can be stripped out and the Compiler itself isn‘t shipped
Testing
Deployment
Deployment Steps & Things to Keep in Mind
Routes are registered in Angular App, so the server won’t know your
routes! Return index.html in case of 404 errors!
What are Directives?
@Directive({
selector: '[appTurnGreen]'
})
export class TurnGreenDirective {
…
}
Course Project
Planning the App
Root
Header
Recipe
Root Dropdown
Header
Recipe
Root
Header
Recipe
Root
Header
Recipe Detail
Root
Header
Recipe Detail
Root
Header
Recipe Detail
Semantic Versioning
MAJOR.MINOR.BUGFIX
e.g. 2.4.3
e.g. 4.0.1
Basics First
… Course Project
More on Directives
…
Debug Eearlier
… Getting Started
… …
Observables
… …
Routing Routing
… Course Project
…
Improved Content
Components Basics
Directives Components
Start at Basics
Course Project Course Project
Have a look at the
Services Directives
Lecture Titles and
skip over Lectures
you‘re not interested in
… …
… …
Routing Routing
… …
Go through the updated
Curriculum and
have a look at the
Routing Routing
Sections & Lectures
Course Project you found most important Course Project
Forms Forms
… …