MCPcopy
hub / github.com/angular-ui/ui-router / NgModelController

Function NgModelController

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

Source from the content-addressed store, hash-verified

30283 */
30284NgModelController.$inject = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$q', '$interpolate'];
30285function NgModelController($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $q, $interpolate) {
30286 this.$viewValue = Number.NaN;
30287 this.$modelValue = Number.NaN;
30288 this.$$rawModelValue = undefined; // stores the parsed modelValue / model set from scope regardless of validity.
30289 this.$validators = {};
30290 this.$asyncValidators = {};
30291 this.$parsers = [];
30292 this.$formatters = [];
30293 this.$viewChangeListeners = [];
30294 this.$untouched = true;
30295 this.$touched = false;
30296 this.$pristine = true;
30297 this.$dirty = false;
30298 this.$valid = true;
30299 this.$invalid = false;
30300 this.$error = {}; // keep invalid keys here
30301 this.$$success = {}; // keep valid keys here
30302 this.$pending = undefined; // keep pending keys here
30303 this.$name = $interpolate($attr.name || '', false)($scope);
30304 this.$$parentForm = nullFormCtrl;
30305 this.$options = defaultModelOptions;
30306 this.$$updateEvents = '';
30307 // Attach the correct context to the event handler function for updateOn
30308 this.$$updateEventHandler = this.$$updateEventHandler.bind(this);
30309
30310 this.$$parsedNgModel = $parse($attr.ngModel);
30311 this.$$parsedNgModelAssign = this.$$parsedNgModel.assign;
30312 this.$$ngModelGet = this.$$parsedNgModel;
30313 this.$$ngModelSet = this.$$parsedNgModelAssign;
30314 this.$$pendingDebounce = null;
30315 this.$$parserValid = undefined;
30316 this.$$parserName = 'parse';
30317
30318 this.$$currentValidationRunId = 0;
30319
30320 this.$$scope = $scope;
30321 this.$$rootScope = $scope.$root;
30322 this.$$attr = $attr;
30323 this.$$element = $element;
30324 this.$$animate = $animate;
30325 this.$$timeout = $timeout;
30326 this.$$parse = $parse;
30327 this.$$q = $q;
30328 this.$$exceptionHandler = $exceptionHandler;
30329
30330 setupValidity(this);
30331 setupModelWatcher(this);
30332}
30333
30334NgModelController.prototype = {
30335 $$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