Skip to content

Can't use async validators, Object doesn't support property or method 'map' #1

@benjamin-wilson

Description

@benjamin-wilson

In validate.ts:

return asyncValidator(control).map(v => {
        const secondary = synchronousValid();
        if (secondary || v) { // compose async and sync validator results
          return Object.assign({}, secondary, v);
        }
});

asyncValidator(control) is not an array

My validator looks like this:

...
@Directive({
    selector: "[selector-name][ngModel]",
    providers: [
        {
            provide: NG_ASYNC_VALIDATORS, useExisting: SelectorClass, multi: true
        }
    ]
})

export class SelectorClass implements Validator {
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions