| 26425 | </example> |
| 26426 | */ |
| 26427 | var ngModelOptionsDirective = function() { |
| 26428 | return { |
| 26429 | restrict: 'A', |
| 26430 | controller: ['$scope', '$attrs', function($scope, $attrs) { |
| 26431 | var that = this; |
| 26432 | this.$options = copy($scope.$eval($attrs.ngModelOptions)); |
| 26433 | // Allow adding/overriding bound events |
| 26434 | if (isDefined(this.$options.updateOn)) { |
| 26435 | this.$options.updateOnDefault = false; |
| 26436 | // extract "default" pseudo-event from list of events that can trigger a model update |
| 26437 | this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP, function() { |
| 26438 | that.$options.updateOnDefault = true; |
| 26439 | return ' '; |
| 26440 | })); |
| 26441 | } else { |
| 26442 | this.$options.updateOnDefault = true; |
| 26443 | } |
| 26444 | }] |
| 26445 | }; |
| 26446 | }; |
| 26447 | |
| 26448 | |
| 26449 | |