| 23944 | </example> |
| 23945 | */ |
| 23946 | var ngModelOptionsDirective = function() { |
| 23947 | return { |
| 23948 | restrict: 'A', |
| 23949 | controller: ['$scope', '$attrs', function($scope, $attrs) { |
| 23950 | var that = this; |
| 23951 | this.$options = $scope.$eval($attrs.ngModelOptions); |
| 23952 | // Allow adding/overriding bound events |
| 23953 | if (this.$options.updateOn !== undefined) { |
| 23954 | this.$options.updateOnDefault = false; |
| 23955 | // extract "default" pseudo-event from list of events that can trigger a model update |
| 23956 | this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP, function() { |
| 23957 | that.$options.updateOnDefault = true; |
| 23958 | return ' '; |
| 23959 | })); |
| 23960 | } else { |
| 23961 | this.$options.updateOnDefault = true; |
| 23962 | } |
| 23963 | }] |
| 23964 | }; |
| 23965 | }; |
| 23966 | |
| 23967 | |
| 23968 | |