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

Function compute

test/angular/1.7/angular.js:13955–13970  ·  view source on GitHub ↗
(values)

Source from the content-addressed store, hash-verified

13953
13954 if (!mustHaveExpression || expressions.length) {
13955 var compute = function(values) {
13956 for (var i = 0, ii = expressions.length; i < ii; i++) {
13957 if (allOrNothing && isUndefined(values[i])) return;
13958 concat[expressionPositions[i]] = values[i];
13959 }
13960
13961 if (contextAllowsConcatenation) {
13962 // If `singleExpression` then `concat[0]` might be a "trusted" value or `null`, rather than a string
13963 return $sce.getTrusted(trustedContext, singleExpression ? concat[0] : concat.join(''));
13964 } else if (trustedContext && concat.length > 1) {
13965 // This context does not allow more than one part, e.g. expr + string or exp + exp.
13966 $interpolateMinErr.throwNoconcat(text);
13967 }
13968 // In an unprivileged context or only one part: just concatenate and return.
13969 return concat.join('');
13970 };
13971
13972 return extend(function interpolationFn(context) {
13973 var i = 0;

Callers 1

$interpolateFunction · 0.70

Calls 1

isUndefinedFunction · 0.70

Tested by

no test coverage detected