Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
8. Custom validations, controls and multi-provi...
Search
iliya
March 01, 2017
0
49
8. Custom validations, controls and multi-providers
Examples:
https://embed.plnkr.co/VJm56Q4hpIIAgkvmzGin/
iliya
March 01, 2017
Tweet
Share
More Decks by iliya
See All by iliya
10. Routing and Navigation 2
iliaidakiev
0
65
9. Routing and Navigation
iliaidakiev
0
76
6. Change Detection
iliaidakiev
0
30
7. Forms and simple validations
iliaidakiev
0
74
5. Predictable Reactive State Management
iliaidakiev
1
82
3. Angular CLI. Custom Directives. Renderer
iliaidakiev
0
73
4. Dependency Injection. Providers and Injectors
iliaidakiev
0
95
2. Functional Programming and RxJS
iliaidakiev
3
520
1. NG Introduction
iliaidakiev
0
160
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
A better future with KSS
kneath
240
18k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
490
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
210
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
140
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
300
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
120
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
Scaling GitHub
holman
464
140k
Transcript
None
Schedule • Custom reactive validations • Multi-providers • Custom template
validations • Custom from controls
Model-driven validations https://github.com/angular/angular/blob/master/modules/ %40angular/forms/src/validators.ts
Custom model-driven validations https://embed.plnkr.co/VJm56Q4hpIIAgkvmzGin/ PostcodeValidation @
Custom async model-driven validations https://embed.plnkr.co/VJm56Q4hpIIAgkvmzGin/ AsyncPostcodeValidation @
ForwardRef • We use it because es6 classes aren't hoisted
• forwardRef takes a function as an argument that returns a class. The argument function is called after the class is declared.
DI Injectors Module Component Component Directive Directive • Every Component
has an Injector • Every Directive takes her parent Component's Injector
Multi Providers
Multi Providers Example (1) Creating a token
Multi Providers Example (2) Creating a directive 1
Multi Providers Example (3) Creating a directive 2
Multi Providers Example (4) Creating a collector
Multi Providers Example (5) Using all directives
Multi Providers Example (6) Example Result
Custom template-driven validations https://embed.plnkr.co/VJm56Q4hpIIAgkvmzGin/ emailValidatorProvider @
Custom async template-driven validations https://embed.plnkr.co/VJm56Q4hpIIAgkvmzGin/ asyncEmailValidatorProvider @
Custom Form Controls https://angular.io/docs/ts/latest/api/forms/index/ControlValueAccessor- interface.html
Custom Form Controls
Custom async template-driven validations https://embed.plnkr.co/VJm56Q4hpIIAgkvmzGin/ CounterComponent @
Questions?