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

Function selectionChanged

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

Source from the content-addressed store, hash-verified

25628 }
25629
25630 function selectionChanged() {
25631 scope.$apply(function() {
25632 var collection = valuesFn(scope) || [];
25633 var viewValue;
25634 if (multiple) {
25635 viewValue = [];
25636 forEach(selectElement.val(), function(selectedKey) {
25637 selectedKey = trackFn ? trackKeysCache[selectedKey] : selectedKey;
25638 viewValue.push(getViewValue(selectedKey, collection[selectedKey]));
25639 });
25640 } else {
25641 var selectedKey = trackFn ? trackKeysCache[selectElement.val()] : selectElement.val();
25642 viewValue = getViewValue(selectedKey, collection[selectedKey]);
25643 }
25644 ctrl.$setViewValue(viewValue);
25645 render();
25646 });
25647 }
25648
25649 function getViewValue(key, value) {
25650 if (key === '?') {

Callers

nothing calls this directly

Calls 3

forEachFunction · 0.70
getViewValueFunction · 0.70
renderFunction · 0.70

Tested by

no test coverage detected