AbstractControl

export class AbstractControl

exported from angular2/common defined in angular2/src/common/forms/model.ts (line 49)

Constructor

constructor(validator: Function, asyncValidator: Function)

Not Yet Documented

Members

validator : Function

Not Yet Documented

asyncValidator : Function

Not Yet Documented

value : any

Not Yet Documented

status : string

Not Yet Documented

valid : boolean

Not Yet Documented

errors : {[key: string]: any}

Returns the errors of this control.

pristine : boolean

Not Yet Documented

dirty : boolean

Not Yet Documented

touched : boolean

Not Yet Documented

untouched : boolean

Not Yet Documented

valueChanges : Observable<any>

Not Yet Documented

statusChanges : Observable<any>

Not Yet Documented

pending : boolean

Not Yet Documented

markAsTouched() : void

Not Yet Documented

markAsDirty({onlySelf}?: {onlySelf?: boolean}) : void

Not Yet Documented

markAsPending({onlySelf}?: {onlySelf?: boolean}) : void

Not Yet Documented

setParent(parent: ControlGroup | ControlArray) : void

Not Yet Documented

updateValueAndValidity({onlySelf, emitEvent}?: {onlySelf?: boolean, emitEvent?: boolean}) : void

Not Yet Documented

setErrors(errors: {[key: string]: any}, {emitEvent}?: {emitEvent?: boolean}) : void

Sets errors on a control.

This is used when validations are run not automatically, but manually by the user.

Calling setErrors will also update the validity of the parent control.

Usage

var login = new Control("someLogin"); login.setErrors({ "notUnique": true }); expect(login.valid).toEqual(false); expect(login.errors).toEqual({"notUnique": true}); login.updateValue("someOtherLogin"); expect(login.valid).toEqual(true);

find(path: Array<string | number>| string) : AbstractControl

Not Yet Documented

getError(errorCode: string, path?: string[]) : any

Not Yet Documented

hasError(errorCode: string, path?: string[]) : boolean

Not Yet Documented