MCPcopy Create free account
hub / github.com/choosehappy/QuickAnnotator / ngModelOptionsDirective

Function ngModelOptionsDirective

static/js/angular.js:31959–31982  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31957 *
31958 */
31959var ngModelOptionsDirective = function() {
31960 NgModelOptionsController.$inject = ['$attrs', '$scope'];
31961 function NgModelOptionsController($attrs, $scope) {
31962 this.$$attrs = $attrs;
31963 this.$$scope = $scope;
31964 }
31965 NgModelOptionsController.prototype = {
31966 $onInit: function() {
31967 var parentOptions = this.parentCtrl ? this.parentCtrl.$options : defaultModelOptions;
31968 var modelOptionsDefinition = this.$$scope.$eval(this.$$attrs.ngModelOptions);
31969
31970 this.$options = parentOptions.createChild(modelOptionsDefinition);
31971 }
31972 };
31973
31974 return {
31975 restrict: 'A',
31976 // ngModelOptions needs to run before ngModel and input directives
31977 priority: 10,
31978 require: {parentCtrl: '?^^ngModelOptions'},
31979 bindToController: true,
31980 controller: NgModelOptionsController
31981 };
31982};
31983
31984
31985// shallow copy over values from `src` that are not already specified on `dst`

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected