MCPcopy Index your code
hub / github.com/angular-ui/ui-router / NgModelController

Function NgModelController

test/angular/1.6/angular.js:29282–29329  ·  view source on GitHub ↗
($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $q, $interpolate)

Source from the content-addressed store, hash-verified

29280 */
29281NgModelController.$inject = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$q', '$interpolate'];
29282function NgModelController($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $q, $interpolate) {
29283 this.$viewValue = Number.NaN;
29284 this.$modelValue = Number.NaN;
29285 this.$$rawModelValue = undefined; // stores the parsed modelValue / model set from scope regardless of validity.
29286 this.$validators = {};
29287 this.$asyncValidators = {};
29288 this.$parsers = [];
29289 this.$formatters = [];
29290 this.$viewChangeListeners = [];
29291 this.$untouched = true;
29292 this.$touched = false;
29293 this.$pristine = true;
29294 this.$dirty = false;
29295 this.$valid = true;
29296 this.$invalid = false;
29297 this.$error = {}; // keep invalid keys here
29298 this.$$success = {}; // keep valid keys here
29299 this.$pending = undefined; // keep pending keys here
29300 this.$name = $interpolate($attr.name || '', false)($scope);
29301 this.$$parentForm = nullFormCtrl;
29302 this.$options = defaultModelOptions;
29303 this.$$updateEvents = '';
29304 // Attach the correct context to the event handler function for updateOn
29305 this.$$updateEventHandler = this.$$updateEventHandler.bind(this);
29306
29307 this.$$parsedNgModel = $parse($attr.ngModel);
29308 this.$$parsedNgModelAssign = this.$$parsedNgModel.assign;
29309 this.$$ngModelGet = this.$$parsedNgModel;
29310 this.$$ngModelSet = this.$$parsedNgModelAssign;
29311 this.$$pendingDebounce = null;
29312 this.$$parserValid = undefined;
29313
29314 this.$$currentValidationRunId = 0;
29315
29316 // https://github.com/angular/angular.js/issues/15833
29317 // Prevent `$$scope` from being iterated over by `copy` when NgModelController is deep watched
29318 Object.defineProperty(this, '$$scope', {value: $scope});
29319 this.$$attr = $attr;
29320 this.$$element = $element;
29321 this.$$animate = $animate;
29322 this.$$timeout = $timeout;
29323 this.$$parse = $parse;
29324 this.$$q = $q;
29325 this.$$exceptionHandler = $exceptionHandler;
29326
29327 setupValidity(this);
29328 setupModelWatcher(this);
29329}
29330
29331NgModelController.prototype = {
29332 $$initGetterSetters: function() {

Callers

nothing calls this directly

Calls 4

$interpolateFunction · 0.70
$parseFunction · 0.70
setupValidityFunction · 0.70
setupModelWatcherFunction · 0.70

Tested by

no test coverage detected