Coder Social home page Coder Social logo

buildjs's People

Contributors

danilo-valente avatar marklinus avatar

Stargazers

 avatar

Watchers

 avatar  avatar

buildjs's Issues

TypeError: Cannot read property 'parse' of undefined

Hi,
I build an angular project using build js, exported that project as a package. when I try to consume the same in another project it is throwing the following error,
code in library ๐Ÿ‘
import { AbstractControl, ValidatorFn } from '@angular/forms';
import * as FinnishSSN from 'finnish-ssn';

export class PinValidatorService {

constructor() { }

/**

  • validate finnish ssn
    */
    public validateFinnishPin(): ValidatorFn {
    return (control: AbstractControl): { [key: string]: boolean } => {
    console.log(FinnishSSN.validate(control.value));
    return FinnishSSN.validate(control.value) ? null : {
    validatePin: false
    };
    }
    }

}

///////////////////////
consuming as follows:
'pin': new FormControl('', [
Validators.required,
this.pinvalidate.validateFinnishPin()
]),

///////////////////////
So somehow I am getting error at @angular/forms

Error: Uncaught (in promise): TypeError: Cannot read property 'parse' of undefined
TypeError: Cannot read property 'parse' of undefined
at validate (http://localhost:4200/build/0.js:4658:21)
at http://localhost:4200/build/0.js:4252:86
at http://localhost:4200/build/vendor.js:36004:49
at Array.map ()
at _executeValidators (http://localhost:4200/build/vendor.js:36004:23)
at FormControl.validator (http://localhost:4200/build/vendor.js:35956:33)
at FormControl.AbstractControl._runValidator (http://localhost:4200/build/vendor.js:38678:38)
at FormControl.AbstractControl.updateValueAndValidity (http://localhost:4200/build/vendor.js:38632:53)
at new FormControl (http://localhost:4200/build/vendor.js:39150:15)
at StaffEditorPage.webpackJsonp.1211.StaffEditorPage.createForm (http://localhost:4200/build/0.js:4846:20)
at c (http://localhost:4200/build/polyfills.js:3:19752)
at http://localhost:4200/build/polyfills.js:3:19174
at http://localhost:4200/build/polyfills.js:3:21242
at t.invoke (http://localhost:4200/build/polyfills.js:3:14976)
at Object.onInvoke (http://localhost:4200/build/vendor.js:5124:33)

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.