From e101c127af0b499d03b93c07460f28cfbffa2cc2 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Fri, 4 Apr 2014 16:50:31 +0100 Subject: [PATCH] docs(ngModelOptions): fix param name and tidy up examples --- src/ng/directive/input.js | 74 ++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 206bc82e..14bc4a03 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -2206,41 +2206,43 @@ var ngValueDirective = function() { * @name ngModelOptions * * @description - * Allows tuning how model updates are done. Using `ngModelOptions` you can specify a custom list of events - * that will trigger a model update and/or a debouncing delay so that the actual update only takes place - * when a timer expires; this timer will be reset after another change takes place. + * Allows tuning how model updates are done. Using `ngModelOptions` you can specify a custom list of + * events that will trigger a model update and/or a debouncing delay so that the actual update only + * takes place when a timer expires; this timer will be reset after another change takes place. * - * @param {Object=} Object that contains options to apply to the current model. Valid keys are: - * - updateOn: string specifying which event should be the input bound to. You can set several events - * using an space delimited list. There is a special event called `default` that - * matches the default events belonging of the control. - * - debounce: integer value which contains the debounce model update value in milliseconds. A value of 0 - * triggers an immediate update. If an object is supplied instead, you can specify a custom value - * for each event. I.e. - * `ngModelOptions="{ updateOn: 'default blur', debounce: {'default': 500, 'blur': 0} }"` + * @param {Object} ngModelOptions options to apply to the current model. Valid keys are: + * - `updateOn`: string specifying which event should be the input bound to. You can set several + * events using an space delimited list. There is a special event called `default` that + * matches the default events belonging of the control. + * - `debounce`: integer value which contains the debounce model update value in milliseconds. A + * value of 0 triggers an immediate update. If an object is supplied instead, you can specify a + * custom value for each event. For example: + * `ngModelOptions="{ updateOn: 'default blur', debounce: {'default': 500, 'blur': 0} }"` * * @example - The following example shows how to override immediate updates. Changes on the inputs within the form will update the model - only when the control loses focus (blur event). + The following example shows how to override immediate updates. Changes on the inputs within the + form will update the model only when the control loses focus (blur event). - + -
-
- Name: -
- Other data: -
-
+ Name: +
+ + Other data: +
+
user.name = 
+ + function Ctrl($scope) { + $scope.user = { name: 'say', data: '' }; + } + var model = element(by.binding('user.name')); var input = element(by.model('user.name')); @@ -2256,21 +2258,21 @@ var ngValueDirective = function() { This one shows how to debounce model changes. Model will be updated only 500 milliseconds after last change. - + - -
-
- Name: -
-
+
+ Name: +
user.name = 
+ + function Ctrl($scope) { + $scope.user = { name: 'say' }; + } + */ var ngModelOptionsDirective = function() {