GithubHelp home page GithubHelp logo

ng-validators's People

Contributors

slavafomin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ng-validators's Issues

Feature ideas

Hey Moebius, Awesome repo here. I've bene on the hunt for a really well written and documented collection of custom validators for Angular 2+. Are you interested in growing this repo? I would be willing to commit all my custom validators if so.

I'm looking for alpha characters only and numeric characters only validators for name fields.

Something like this for alpha only:

import { FormControl } from '@angular/forms';

export class AlphaOnlyValidator {
    static invalidAlphaOnly(control: FormControl): { [key: string]: boolean } {
        if (control.value.length && !control.value.match(/^[a-z]+$/i)) {
            return { invalidAlphaNumeric: true };
        }
        return null;
    }
}

Cause Angular AoT build errors

Hi,

This plugin cause an "AoT build failed" error when compiling a project in production mode.
Output of error :

`typescript error:
Error encountered resolving symbol values statically. Calling function 'ɵmakeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function,
resolving symbol Injectable in path_to_project/node_modules/@moebius/ng-validators/node_modules/@angular/core/core.d.ts,
resolving symbol ɵi in path_to_project/node_modules/@moebius/ng-validators/node_modules/@angular/forms/forms.d.ts,
resolving symbol ɵi in path_to_project/node_modules/@moebius/ng-validators/node_modules/@angular/forms/forms.d.ts

Error: The Angular AoT build failed.`

Your plugin seems to not been compatible with Angular AoT,

Thank you

Expected validator to return Promise or Observable.

I am getting this error on Angular 4+

Expected validator to return Promise or Observable.

Using like this:
this.newPasswordForm = this.formBuilder.group({ password: ['', [Validators.required, Validators.minLength(6)]], password2: ['', [Validators.required, matchOtherValidator("password")]] });

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.