MCPcopy Create free account
hub / github.com/betsol/angular-input-modified / onInputValueChanged

Function onInputValueChanged

src/directive/ngModel.js:90–112  ·  view source on GitHub ↗

* Sets proper modification state for model controller according to * current/master value.

()

Source from the content-addressed store, hash-verified

88 * current/master value.
89 */
90 function onInputValueChanged () {
91
92 if (!masterValueIsSet) {
93 initializeMasterValue();
94 }
95
96 var modified = !compare(modelCtrl.$modelValue, modelCtrl.masterValue);
97
98 // If modified flag has changed.
99 if (modelCtrl.modified !== modified) {
100
101 // Setting new flag.
102 modelCtrl.modified = modified;
103
104 // Notifying the form.
105 if (formCtrl && 'function' === typeof formCtrl.$$onChildModelModifiedStateChanged) {
106 formCtrl.$$onChildModelModifiedStateChanged(modelCtrl);
107 }
108
109 // Re-decorating the element.
110 updateCssClasses();
111 }
112 }
113
114 /**
115 * Initializes master value if required.

Callers

nothing calls this directly

Calls 3

initializeMasterValueFunction · 0.85
compareFunction · 0.85
updateCssClassesFunction · 0.70

Tested by

no test coverage detected