| 25558 | </example> |
| 25559 | */ |
| 25560 | var ngModelOptionsDirective = function() { |
| 25561 | return { |
| 25562 | restrict: 'A', |
| 25563 | controller: ['$scope', '$attrs', function($scope, $attrs) { |
| 25564 | var that = this; |
| 25565 | this.$options = copy($scope.$eval($attrs.ngModelOptions)); |
| 25566 | // Allow adding/overriding bound events |
| 25567 | if (this.$options.updateOn !== undefined) { |
| 25568 | this.$options.updateOnDefault = false; |
| 25569 | // extract "default" pseudo-event from list of events that can trigger a model update |
| 25570 | this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP, function() { |
| 25571 | that.$options.updateOnDefault = true; |
| 25572 | return ' '; |
| 25573 | })); |
| 25574 | } else { |
| 25575 | this.$options.updateOnDefault = true; |
| 25576 | } |
| 25577 | }] |
| 25578 | }; |
| 25579 | }; |
| 25580 | |
| 25581 | |
| 25582 | |