MCPcopy
hub / github.com/angular-ui/ui-grid / $ParseProvider

Function $ParseProvider

lib/test/angular/1.8.0/angular.js:17364–17655  ·  view source on GitHub ↗

* @ngdoc provider * @name $parseProvider * @this * * @description * `$parseProvider` can be used for configuring the default behavior of the ng.$parse $parse * service.

()

Source from the content-addressed store, hash-verified

17362 * service.
17363 */
17364function $ParseProvider() {
17365 var cache = createMap();
17366 var literals = {
17367 'true': true,
17368 'false': false,
17369 'null': null,
17370 'undefined': undefined
17371 };
17372 var identStart, identContinue;
17373
17374 /**
17375 * @ngdoc method
17376 * @name $parseProvider#addLiteral
17377 * @description
17378 *
17379 * Configure $parse service to add literal values that will be present as literal at expressions.
17380 *
17381 * @param {string} literalName Token for the literal value. The literal name value must be a valid literal name.
17382 * @param {*} literalValue Value for this literal. All literal values must be primitives or `undefined`.
17383 *
17384 **/
17385 this.addLiteral = function(literalName, literalValue) {
17386 literals[literalName] = literalValue;
17387 };
17388
17389 /**
17390 * @ngdoc method
17391 * @name $parseProvider#setIdentifierFns
17392 *
17393 * @description
17394 *
17395 * Allows defining the set of characters that are allowed in AngularJS expressions. The function
17396 * `identifierStart` will get called to know if a given character is a valid character to be the
17397 * first character for an identifier. The function `identifierContinue` will get called to know if
17398 * a given character is a valid character to be a follow-up identifier character. The functions
17399 * `identifierStart` and `identifierContinue` will receive as arguments the single character to be
17400 * identifier and the character code point. These arguments will be `string` and `numeric`. Keep in
17401 * mind that the `string` parameter can be two characters long depending on the character
17402 * representation. It is expected for the function to return `true` or `false`, whether that
17403 * character is allowed or not.
17404 *
17405 * Since this function will be called extensively, keep the implementation of these functions fast,
17406 * as the performance of these functions have a direct impact on the expressions parsing speed.
17407 *
17408 * @param {function=} identifierStart The function that will decide whether the given character is
17409 * a valid identifier start character.
17410 * @param {function=} identifierContinue The function that will decide whether the given character is
17411 * a valid identifier continue character.
17412 */
17413 this.setIdentifierFns = function(identifierStart, identifierContinue) {
17414 identStart = identifierStart;
17415 identContinue = identifierContinue;
17416 return this;
17417 };
17418
17419 this.$get = ['$filter', function($filter) {
17420 var noUnsafeEval = csp().noUnsafeEval;
17421 var $parseOptions = {

Callers

nothing calls this directly

Calls 4

createMapFunction · 0.70
cspFunction · 0.70
copyFunction · 0.70
isFunctionFunction · 0.70

Tested by

no test coverage detected