Comments (4)
trong hàm validator bạn có thể chọn ra fields mình muốn để check mà. bạn kham khảo thử chổ người ta check password match với nhau trong đây: https://codinglatte.com/posts/angular/cool-password-validation-angular/
from 100-days-of-angular.
Nó chỉ set error thôi.Chứ mình thấy trong project khi thay đổi email nó vẫn chạy hàm validate của formGroup.Vậy nếu th async thì nó sẽ call api lên hệ thống
from 100-days-of-angular.
@TND195 Mình chưa gặp trường hợp này bao giờ nhưng đơn giản nhất là như bạn nói, tạo ra một formGroup riêng cho field A và B. Rồi khi submit form thì merge formGroup chứa A,B và C thành một object thôi. Nếu ko thì phải code hơi thủ công ở hàm async validator trước khi tạo request lên server validate
from 100-days-of-angular.
Cảm ơn bạn.Tại mình muốn xem có giải pháp nào hay hơn không?Do nghiệp dự án gặp nhiều trường hợp thế này.Mình sợ sau này còn thêm check A, B,D thì khó bỏ trong group được.
from 100-days-of-angular.
Related Issues (20)
- Tuyệt vời cảm ơn các anh
- Translation? HOT 2
- Chưa thấy lifecycle anh nhỉ? HOT 1
- 100 ngày với angular
- Day 42. Giới thiệu state management, what, why, how
- Day 43. ngrx action, reducer, selector
- Day 44. ngrx effect
- Day 38 - Gặp lỗi khi lazy load component có dùng *ngIf hoặc cần import từ module khác HOT 6
- Day 37 - Async Validator HOT 3
- Day 38 - Template Form Custom Validator
- Day 37: Async Validator trong Angular Form - về cách tạo custom validators HOT 2
- Angular HOT 1
- Angular 100 HOT 1
- 100days angular
- Thank you HOT 1
- Angular
- Spanish Traslation HOT 2
- Day007 - Khi nào nên dùng ngOnChanges hay setter/getter HOT 7
- Angular
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 100-days-of-angular.