109 lines
1.1 KiB
Plaintext
109 lines
1.1 KiB
Plaintext
|
|
p.location-badge.
|
|
exported from <a href='../forms'>angular2/forms</a>
|
|
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/forms/directives/ng_model.ts#L12-L63">angular2/src/forms/directives/ng_model.ts (line 12)</a>
|
|
|
|
:markdown
|
|
Binds a domain model to the form.
|
|
|
|
# Example
|
|
```
|
|
@Component({selector: "search-comp"})
|
|
@View({
|
|
directives: [formDirectives],
|
|
template: `
|
|
<input type='text' [(ng-model)]="searchQuery">
|
|
`})
|
|
class SearchComp {
|
|
searchQuery: string;
|
|
}
|
|
```
|
|
|
|
.l-main-section
|
|
h2 Members
|
|
.l-sub-section
|
|
h3 ngModel
|
|
|
|
|
|
:markdown
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.l-sub-section
|
|
h3 model
|
|
|
|
|
|
:markdown
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.l-sub-section
|
|
h3 onChange
|
|
|
|
|
|
pre.prettyprint
|
|
code.
|
|
onChange(c)
|
|
|
|
:markdown
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.l-sub-section
|
|
h3 control
|
|
|
|
|
|
:markdown
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.l-sub-section
|
|
h3 path
|
|
|
|
|
|
:markdown
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.l-sub-section
|
|
h3 viewToModelUpdate
|
|
|
|
|
|
pre.prettyprint
|
|
code.
|
|
viewToModelUpdate(newValue: any)
|
|
|
|
:markdown
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|