MCPcopy Create free account
hub / github.com/apache/cloudstack / $ParseProvider

Function $ParseProvider

tools/ngui/static/js/lib/angular.js:6615–6631  ·  view source on GitHub ↗

* @ngdoc function * @name ng.$parse * @function * * @description * * Converts Angular guide/expression expression into a function. * * * var getter = $parse('user.name'); * var setter = getter.assign; * var context = {user:{name:'angular'}}; * var locals = {user:{na

()

Source from the content-addressed store, hash-verified

6613 *
6614 */
6615function $ParseProvider() {
6616 var cache = {};
6617 this.$get = ['$filter', '$sniffer', function($filter, $sniffer) {
6618 return function(exp) {
6619 switch(typeof exp) {
6620 case 'string':
6621 return cache.hasOwnProperty(exp)
6622 ? cache[exp]
6623 : cache[exp] = parser(exp, false, $filter, $sniffer.csp);
6624 case 'function':
6625 return exp;
6626 default:
6627 return noop;
6628 }
6629 };
6630 }];
6631}
6632
6633/**
6634 * @ngdoc service

Callers

nothing calls this directly

Calls 1

parserFunction · 0.85

Tested by

no test coverage detected