| 28943 | </example> |
| 28944 | */ |
| 28945 | var ngModelOptionsDirective = function() { |
| 28946 | return { |
| 28947 | restrict: 'A', |
| 28948 | controller: ['$scope', '$attrs', function NgModelOptionsController($scope, $attrs) { |
| 28949 | var that = this; |
| 28950 | this.$options = copy($scope.$eval($attrs.ngModelOptions)); |
| 28951 | // Allow adding/overriding bound events |
| 28952 | if (isDefined(this.$options.updateOn)) { |
| 28953 | this.$options.updateOnDefault = false; |
| 28954 | // extract "default" pseudo-event from list of events that can trigger a model update |
| 28955 | this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP, function() { |
| 28956 | that.$options.updateOnDefault = true; |
| 28957 | return ' '; |
| 28958 | })); |
| 28959 | } else { |
| 28960 | this.$options.updateOnDefault = true; |
| 28961 | } |
| 28962 | }] |
| 28963 | }; |
| 28964 | }; |
| 28965 | |
| 28966 | |
| 28967 | |