Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
8. Custom validations, controls and multi-provi...
Search
iliya
March 01, 2017
69
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
8. Custom validations, controls and multi-providers
Examples:
https://embed.plnkr.co/VJm56Q4hpIIAgkvmzGin/
iliya
March 01, 2017
Transcript
20 slides
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?
More Decks by iliya
See All by iliya
10. Routing and Navigation 2
iliaidakiev
0
83
9. Routing and Navigation
iliaidakiev
0
100
6. Change Detection
iliaidakiev
0
48
7. Forms and simple validations
iliaidakiev
0
100
5. Predictable Reactive State Management
iliaidakiev
1
99
3. Angular CLI. Custom Directives. Renderer
iliaidakiev
0
93
4. Dependency Injection. Providers and Injectors
iliaidakiev
0
120
2. Functional Programming and RxJS
iliaidakiev
3
550
1. NG Introduction
iliaidakiev
0
190
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
96
14k
Writing Fast Ruby
sferik
630
63k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
790
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
350
GitHub's CSS Performance
jonrohan
1033
470k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Marketing to machines
jonoalderson
1
6k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
660
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
620