| 26887 | </example> |
| 26888 | */ |
| 26889 | var ngModelOptionsDirective = function() { |
| 26890 | return { |
| 26891 | restrict: 'A', |
| 26892 | controller: ['$scope', '$attrs', function($scope, $attrs) { |
| 26893 | var that = this; |
| 26894 | this.$options = copy($scope.$eval($attrs.ngModelOptions)); |
| 26895 | // Allow adding/overriding bound events |
| 26896 | if (isDefined(this.$options.updateOn)) { |
| 26897 | this.$options.updateOnDefault = false; |
| 26898 | // extract "default" pseudo-event from list of events that can trigger a model update |
| 26899 | this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP, function() { |
| 26900 | that.$options.updateOnDefault = true; |
| 26901 | return ' '; |
| 26902 | })); |
| 26903 | } else { |
| 26904 | this.$options.updateOnDefault = true; |
| 26905 | } |
| 26906 | }] |
| 26907 | }; |
| 26908 | }; |
| 26909 | |
| 26910 | |
| 26911 | |