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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
iliya
March 01, 2017
52
0
Share
8. Custom validations, controls and multi-providers
Examples:
https://embed.plnkr.co/VJm56Q4hpIIAgkvmzGin/
iliya
March 01, 2017
More Decks by iliya
See All by iliya
10. Routing and Navigation 2
iliaidakiev
0
68
9. Routing and Navigation
iliaidakiev
0
80
6. Change Detection
iliaidakiev
0
32
7. Forms and simple validations
iliaidakiev
0
77
5. Predictable Reactive State Management
iliaidakiev
1
83
3. Angular CLI. Custom Directives. Renderer
iliaidakiev
0
77
4. Dependency Injection. Providers and Injectors
iliaidakiev
0
100
2. Functional Programming and RxJS
iliaidakiev
3
530
1. NG Introduction
iliaidakiev
0
160
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
930
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.5k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Paper Plane
katiecoart
PRO
1
50k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
Discover your Explorer Soul
emna__ayadi
2
1.1k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
340
Design in an AI World
tapps
1
220
Documentation Writing (for coders)
carmenintech
77
5.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Crafting Experiences
bethany
1
160
We Have a Design System, Now What?
morganepeng
55
8.2k
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?