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
48
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
64
9. Routing and Navigation
iliaidakiev
0
72
6. Change Detection
iliaidakiev
0
29
7. Forms and simple validations
iliaidakiev
0
73
5. Predictable Reactive State Management
iliaidakiev
1
81
3. Angular CLI. Custom Directives. Renderer
iliaidakiev
0
70
4. Dependency Injection. Providers and Injectors
iliaidakiev
0
93
2. Functional Programming and RxJS
iliaidakiev
3
520
1. NG Introduction
iliaidakiev
0
160
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
96
The Language of Interfaces
destraynor
162
26k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
97
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.2k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
200
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
120
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
350
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
Optimizing for Happiness
mojombo
379
70k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
220
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?