MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / ngModelOptionsDirective

Function ngModelOptionsDirective

code/songhop/www/lib/angular/angular.js:21684–21703  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21682 </example>
21683 */
21684var ngModelOptionsDirective = function() {
21685 return {
21686 restrict: 'A',
21687 controller: ['$scope', '$attrs', function($scope, $attrs) {
21688 var that = this;
21689 this.$options = $scope.$eval($attrs.ngModelOptions);
21690 // Allow adding/overriding bound events
21691 if (this.$options.updateOn !== undefined) {
21692 this.$options.updateOnDefault = false;
21693 // extract "default" pseudo-event from list of events that can trigger a model update
21694 this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP, function() {
21695 that.$options.updateOnDefault = true;
21696 return ' ';
21697 }));
21698 } else {
21699 this.$options.updateOnDefault = true;
21700 }
21701 }]
21702 };
21703};
21704
21705// helper methods
21706function addSetValidityMethod(context) {

Callers

nothing calls this directly

Calls 1

trimFunction · 0.70

Tested by

no test coverage detected