NgModel

export directive NgModel

exported from angular2/common defined in angular2/src/common/forms/directives/ng_model.ts (line 27)

Binds a domain model to a form control.

Usage

ngModel binds an existing domain model to a form control. For a two-way binding, use [(ngModel)] to ensure the model updates in both directions.

Example (live demo)

@Component({ selector: "search-comp", directives: [FORM_DIRECTIVES], template: `<input type='text' [(ngModel)]="searchQuery">` }) class SearchComp { searchQuery: string; }

Selectors

[ngModel]:not([ngControl]):not([ngFormControl])

Inputs

ng-model bound to NgModel.model

Outputs

ng-model-change bound to NgModel.update

Exported As

ngForm

Constructor

constructor(_validators: any[], _asyncValidators: any[], valueAccessors: ControlValueAccessor[])

Not Yet Documented

Members

update : EventEmitter

Not Yet Documented

model : any

Not Yet Documented

viewModel : any

Not Yet Documented

ngOnChanges(changes: {[key: string]: SimpleChange})

Not Yet Documented

control : Control

Not Yet Documented

path : string[]

Not Yet Documented

validator : Function

Not Yet Documented

asyncValidator : Function

Not Yet Documented

viewToModelUpdate(newValue: any) : void

Not Yet Documented