aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/error/ngModel/nonassign.ngdoc
blob: cc6e3f716608ca0ed3dbe617545a6831b472ed96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@ngdoc error
@name ngModel:nonassign
@fullName Non-Assignable Expression
@description

This error occurs when expression the {@link ng.directive:ngModel ngModel} directive is bound to is a non-assignable expression.

Examples using assignable expressions include:

```
<input ng-model="namedVariable">
<input ng-model="myObj.someProperty">
<input ng-model="indexedArray[0]">
```

Examples of non-assignable expressions include:

```
<input ng-model="foo + bar">
<input ng-model="42">
<input ng-model="'oops'">
<input ng-model="myFunc()">
```

Always make sure that the expression bound via `ngModel` directive can be assigned to.

For more information, see the {@link ng.directive:ngModel ngModel API doc}.