@@ -2206,41 +2206,43 @@ var ngValueDirective = function() {
2206
2206
* @name ngModelOptions
2207
2207
*
2208
2208
* @description
2209
- * Allows tuning how model updates are done. Using `ngModelOptions` you can specify a custom list of events
2210
- * that will trigger a model update and/or a debouncing delay so that the actual update only takes place
2211
- * when a timer expires; this timer will be reset after another change takes place.
2209
+ * Allows tuning how model updates are done. Using `ngModelOptions` you can specify a custom list of
2210
+ * events that will trigger a model update and/or a debouncing delay so that the actual update only
2211
+ * takes place when a timer expires; this timer will be reset after another change takes place.
2212
2212
*
2213
- * @param {Object= } Object that contains options to apply to the current model. Valid keys are:
2214
- * - updateOn: string specifying which event should be the input bound to. You can set several events
2215
- * using an space delimited list. There is a special event called `default` that
2216
- * matches the default events belonging of the control.
2217
- * - debounce: integer value which contains the debounce model update value in milliseconds. A value of 0
2218
- * triggers an immediate update. If an object is supplied instead, you can specify a custom value
2219
- * for each event. I.e.
2220
- * `ngModelOptions="{ updateOn: 'default blur', debounce: {'default': 500, 'blur': 0} }"`
2213
+ * @param {Object } ngModelOptions options to apply to the current model. Valid keys are:
2214
+ * - ` updateOn` : string specifying which event should be the input bound to. You can set several
2215
+ * events using an space delimited list. There is a special event called `default` that
2216
+ * matches the default events belonging of the control.
2217
+ * - ` debounce` : integer value which contains the debounce model update value in milliseconds. A
2218
+ * value of 0 triggers an immediate update. If an object is supplied instead, you can specify a
2219
+ * custom value for each event. For example:
2220
+ * `ngModelOptions="{ updateOn: 'default blur', debounce: {'default': 500, 'blur': 0} }"`
2221
2221
*
2222
2222
* @example
2223
2223
2224
- The following example shows how to override immediate updates. Changes on the inputs within the form will update the model
2225
- only when the control loses focus (blur event).
2224
+ The following example shows how to override immediate updates. Changes on the inputs within the
2225
+ form will update the model only when the control loses focus (blur event).
2226
2226
2227
- <example name="ngModelOptions-directive-1 ">
2227
+ <example name="ngModelOptions-directive-blur ">
2228
2228
<file name="index.html">
2229
- <script>
2230
- function Ctrl($scope) {
2231
- $scope.user = { name: 'say', data: '' };
2232
- }
2233
- </script>
2234
2229
<div ng-controller="Ctrl">
2235
- <form>
2236
- Name:
2237
- <input type="text" ng-model="user.name" ng-model-options="{ updateOn: 'blur' }" name="uName" /><br />
2238
- Other data:
2239
- <input type="text" ng-model="user.data" name="uData" /><br />
2240
- </form>
2230
+ Name:
2231
+ <input type="text"
2232
+ ng-model="user.name"
2233
+ ng-model-options="{ updateOn: 'blur' }" /><br />
2234
+
2235
+ Other data:
2236
+ <input type="text" ng-model="user.data" /><br />
2237
+
2241
2238
<pre>user.name = <span ng-bind="user.name"></span></pre>
2242
2239
</div>
2243
2240
</file>
2241
+ <file name="app.js">
2242
+ function Ctrl($scope) {
2243
+ $scope.user = { name: 'say', data: '' };
2244
+ }
2245
+ </file>
2244
2246
<file name="protractor.js" type="protractor">
2245
2247
var model = element(by.binding('user.name'));
2246
2248
var input = element(by.model('user.name'));
@@ -2256,21 +2258,21 @@ var ngValueDirective = function() {
2256
2258
2257
2259
This one shows how to debounce model changes. Model will be updated only 500 milliseconds after last change.
2258
2260
2259
- <example name="ngModelOptions-directive-2 ">
2261
+ <example name="ngModelOptions-directive-debounce ">
2260
2262
<file name="index.html">
2261
- <script>
2262
- function Ctrl($scope) {
2263
- $scope.user = { name: 'say' };
2264
- }
2265
- </script>
2266
- <div ng-controller="Ctrl">
2267
- <form>
2268
- Name:
2269
- <input type="text" ng-model="user.name" name="uName" ng-model-options="{ debounce: 500 }" /><br />
2270
- </form>
2263
+ <div ng-controller="Ctrl">
2264
+ Name:
2265
+ <input type="text"
2266
+ ng-model="user.name"
2267
+ ng-model-options="{ debounce: 500 }" /><br />
2271
2268
<pre>user.name = <span ng-bind="user.name"></span></pre>
2272
2269
</div>
2273
2270
</file>
2271
+ <file name="app.js">
2272
+ function Ctrl($scope) {
2273
+ $scope.user = { name: 'say' };
2274
+ }
2275
+ </file>
2274
2276
</example>
2275
2277
*/
2276
2278
var ngModelOptionsDirective = function ( ) {
0 commit comments