MCPcopy
hub / github.com/angular-ui/ui-router / $parse

Function $parse

test/angular/1.7/angular.js:17365–17390  ·  view source on GitHub ↗
(exp, interceptorFn)

Source from the content-addressed store, hash-verified

17363 return $parse;
17364
17365 function $parse(exp, interceptorFn) {
17366 var parsedExpression, cacheKey;
17367
17368 switch (typeof exp) {
17369 case 'string':
17370 exp = exp.trim();
17371 cacheKey = exp;
17372
17373 parsedExpression = cache[cacheKey];
17374
17375 if (!parsedExpression) {
17376 var lexer = new Lexer($parseOptions);
17377 var parser = new Parser(lexer, $filter, $parseOptions);
17378 parsedExpression = parser.parse(exp);
17379
17380 cache[cacheKey] = addWatchDelegate(parsedExpression);
17381 }
17382 return addInterceptor(parsedExpression, interceptorFn);
17383
17384 case 'function':
17385 return addInterceptor(exp, interceptorFn);
17386
17387 default:
17388 return addInterceptor(noop, interceptorFn);
17389 }
17390 }
17391
17392 function $$getAst(exp) {
17393 var lexer = new Lexer($parseOptions);

Callers 15

addPropertyDirectiveFunction · 0.70
$interpolateFunction · 0.70
$RootScopeProviderFunction · 0.70
$SceProviderFunction · 0.70
processPredicatesFunction · 0.70
getSetterFunction · 0.70
createDateInputTypeFunction · 0.70
numberInputTypeFunction · 0.70
parseConstantExprFunction · 0.70
angular.jsFile · 0.70
classDirectiveFunction · 0.70

Calls 2

addWatchDelegateFunction · 0.85
addInterceptorFunction · 0.70

Tested by

no test coverage detected