yuyang041060120 / ng2-validation

angular2 validation
https://yuyang041060120.github.io/ng2-validation/index.html
MIT License
611 stars 213 forks source link

Rollup issue #66

Open nykewl opened 7 years ago

nykewl commented 7 years ago

I am trying to create an IIFE bundle of Angular components that import various validators from ng2-validation . The bundle is created successfully but during runtime I get an error. "TypeError: Cannot read property 'email' of undefined". Any ideas or suggestions to resolve this would be appreciated. Thanks

var core_1$7 = require$$0$10;
var forms_1$11 = require$$0$11;
var index_1 = index$15;
var EMAIL_VALIDATOR = {
    provide: forms_1$11.NG_VALIDATORS,
    useExisting: core_1$7.forwardRef(function () { return EmailValidator; }),
    multi: true
};
var EmailValidator = (function () {
    function EmailValidator() {
    }
    EmailValidator.prototype.validate = function (c) {
     return index_1.email(c);  //<-***** LOCATION OF ERROR *****
    };
    EmailValidator.decorators = [
        { type: core_1$7.Directive, args: [{
                    selector: '[email][formControlName],[email][formControl],[email][ngModel]',
                    providers: [EMAIL_VALIDATOR]
                },] },
    ];
    /** @nocollapse */
    EmailValidator.ctorParameters = [];
    return EmailValidator;
}());
var EmailValidator_1 = EmailValidator;