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

Function render

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

Source from the content-addressed store, hash-verified

25738 }
25739
25740 function render() {
25741 renderScheduled = false;
25742
25743 // Temporary location for the option groups before we render them
25744 var optionGroups = {'':[]},
25745 optionGroupNames = [''],
25746 optionGroupName,
25747 optionGroup,
25748 option,
25749 existingParent, existingOptions, existingOption,
25750 viewValue = ctrl.$viewValue,
25751 values = valuesFn(scope) || [],
25752 keys = keyName ? sortedKeys(values) : values,
25753 key,
25754 value,
25755 groupLength, length,
25756 groupIndex, index,
25757 labelMap = {},
25758 selected,
25759 isSelected = createIsSelectedFn(viewValue),
25760 anySelected = false,
25761 lastElement,
25762 element,
25763 label,
25764 optionId;
25765
25766 trackKeysCache = {};
25767
25768 // We now build up the list of options we need (we merge later)
25769 for (index = 0; length = keys.length, index < length; index++) {
25770 key = index;
25771 if (keyName) {
25772 key = keys[index];
25773 if (key.charAt(0) === '$') continue;
25774 }
25775 value = values[key];
25776
25777 optionGroupName = callExpression(groupByFn, key, value) || '';
25778 if (!(optionGroup = optionGroups[optionGroupName])) {
25779 optionGroup = optionGroups[optionGroupName] = [];
25780 optionGroupNames.push(optionGroupName);
25781 }
25782
25783 selected = isSelected(key, value);
25784 anySelected = anySelected || selected;
25785
25786 label = callExpression(displayFn, key, value); // what will be seen by the user
25787
25788 // doing displayFn(scope, locals) || '' overwrites zero values
25789 label = isDefined(label) ? label : '';
25790 optionId = trackFn ? trackFn(scope, locals) : (keyName ? keys[index] : index);
25791 if (trackFn) {
25792 trackKeysCache[optionId] = key;
25793 }
25794
25795 optionGroup.push({
25796 // either the index into array or key from object
25797 id: optionId,

Callers 1

selectionChangedFunction · 0.70

Calls 6

sortedKeysFunction · 0.70
createIsSelectedFnFunction · 0.70
callExpressionFunction · 0.70
isDefinedFunction · 0.70
updateLabelMapFunction · 0.70
forEachFunction · 0.70

Tested by

no test coverage detected