Code Monkey home page Code Monkey logo

Comments (4)

tntruong96 avatar tntruong96 commented on April 27, 2024

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.

TND195 avatar TND195 commented on April 27, 2024

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.

trungvose avatar trungvose commented on April 27, 2024

@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.

TND195 avatar TND195 commented on April 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.