Coder Social home page Coder Social logo

angular-generic-validator's Introduction

angular-generic-validator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

angular-generic-validator's Issues

Dynamic forms will probably be an issue

Hi @DeborahK the genericValidator looks super cool, and I was keen to use this. However while doing a deep dive in the code, I noticed that you subscribe in an ngAfterViewInit method, and in it we fetch all the controls using a @ViewChildren to get the form elements and also subscribe to their Blur Events observable.

If we now have a Form Array and are adding extra tags, then as the component class is already created, our formInputElements will not get updated, and we will not be doing any validation on the newly added Form Controls, and so they will miss out on being validated by the genericValidator.

It may be possible to unsubscribe and then resubscribe each time you add a control, but this didn't feel ideal either.

Anyhow, this may be a possible gotcha, and therefore perhaps worth pointing out in the Read Me.

Form Arrays

Really good generic validator but it does not seem to work with form-arrays. Even if it did how would the user identify the correct error message to display as there would be multiple formcontrols with the same name

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.