Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit a83a209

Browse files
committed
docs(ngModelOptions): minor fixes/improvements
1 parent cc8ea72 commit a83a209

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

src/ng/directive/ngModel.js

+24-19
Original file line numberDiff line numberDiff line change
@@ -1163,8 +1163,8 @@ var ngModelDirective = ['$rootScope', function($rootScope) {
11631163
*
11641164
* ```html
11651165
* <div ng-model-options="{ allowInvalid: true }">
1166-
* <form ng-model-options="{ updateOn: \'blur\' }">
1167-
* <input ng-model-options="{ updateOn: \'default\' }">
1166+
* <form ng-model-options="{ updateOn: 'blur' }">
1167+
* <input ng-model-options="{ updateOn: 'default' }" />
11681168
* </form>
11691169
* </div>
11701170
* ```
@@ -1204,14 +1204,17 @@ var ngModelDirective = ['$rootScope', function($rootScope) {
12041204
* <file name="index.html">
12051205
* <div ng-controller="ExampleController">
12061206
* <form name="userForm">
1207-
* Name:
1208-
* <input type="text" name="userName"
1209-
* ng-model="user.name"
1210-
* ng-model-options="{ updateOn: 'blur' }"
1211-
* ng-keyup="cancel($event)" /><br />
1212-
*
1213-
* Other data:
1214-
* <input type="text" ng-model="user.data" /><br />
1207+
* <label>
1208+
* Name:
1209+
* <input type="text" name="userName"
1210+
* ng-model="user.name"
1211+
* ng-model-options="{ updateOn: 'blur' }"
1212+
* ng-keyup="cancel($event)" />
1213+
* </label><br />
1214+
* <label>
1215+
* Other data:
1216+
* <input type="text" ng-model="user.data" />
1217+
* </label><br />
12151218
* </form>
12161219
* <pre>user.name = <span ng-bind="user.name"></span></pre>
12171220
* </div>
@@ -1278,9 +1281,9 @@ var ngModelDirective = ['$rootScope', function($rootScope) {
12781281
*
12791282
* ## Model updates and validation
12801283
*
1281-
* The default behaviour in `ngModel` is that the model value is set to `null` when the validation
1282-
* determines that the value is invalid. By setting the `allowInvalid` property to true, the model
1283-
* will still be updated even if the value is invalid.
1284+
* The default behaviour in `ngModel` is that the model value is set to `undefined` when the
1285+
* validation determines that the value is invalid. By setting the `allowInvalid` property to true,
1286+
* the model will still be updated even if the value is invalid.
12841287
*
12851288
*
12861289
* ## Connecting to the scope
@@ -1294,10 +1297,12 @@ var ngModelDirective = ['$rootScope', function($rootScope) {
12941297
* <file name="index.html">
12951298
* <div ng-controller="ExampleController">
12961299
* <form name="userForm">
1297-
* Name:
1298-
* <input type="text" name="userName"
1299-
* ng-model="user.name"
1300-
* ng-model-options="{ getterSetter: true }" />
1300+
* <label>
1301+
* Name:
1302+
* <input type="text" name="userName"
1303+
* ng-model="user.name"
1304+
* ng-model-options="{ getterSetter: true }" />
1305+
* </label>
13011306
* </form>
13021307
* <pre>user.name = <span ng-bind="user.name()"></span></pre>
13031308
* </div>
@@ -1324,7 +1329,7 @@ var ngModelDirective = ['$rootScope', function($rootScope) {
13241329
* @param {Object} ngModelOptions options to apply to the current model. Valid keys are:
13251330
* - `updateOn`: string specifying which event should the input be bound to. You can set several
13261331
* events using an space delimited list. There is a special event called `default` that
1327-
* matches the default events belonging of the control.
1332+
* matches the default events belonging to the control.
13281333
* - `debounce`: integer value which contains the debounce model update value in milliseconds. A
13291334
* value of 0 triggers an immediate update. If an object is supplied instead, you can specify a
13301335
* custom value for each event. For example:
@@ -1334,7 +1339,7 @@ var ngModelDirective = ['$rootScope', function($rootScope) {
13341339
* - `getterSetter`: boolean value which determines whether or not to treat functions bound to
13351340
* `ngModel` as getters/setters.
13361341
* - `timezone`: Defines the timezone to be used to read/write the `Date` instance in the model for
1337-
* `<input type="date">`, `<input type="time">`, ... . It understands UTC/GMT and the
1342+
* `<input type="date" />`, `<input type="time" />`, ... . It understands UTC/GMT and the
13381343
* continental US time zone abbreviations, but for general use, use a time zone offset, for
13391344
* example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)
13401345
* If not specified, the timezone of the browser will be used.

0 commit comments

Comments
 (0)