forked from angular/angular.js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodule.js
48 lines (42 loc) · 1.2 KB
/
module.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
'use strict';
/* eslint-disable new-cap */
/**
* @ngdoc module
* @name ngParseExt
* @packageName angular-parse-ext
* @description
*
* # ngParseExt
*
* The `ngParseExt` module provides functionality to allow Unicode characters in
* identifiers inside AngularJS expressions.
*
*
* <div doc-module-components="ngParseExt"></div>
*
* This module allows the usage of any identifier that follows ES6 identifier naming convention
* to be used as an identifier in an AngularJS expression. ES6 delegates some of the identifier
* rules definition to Unicode, this module uses ES6 and Unicode 8.0 identifiers convention.
*
*/
/* global angularParseExtModule: true,
IDS_Y,
IDC_Y
*/
function isValidIdentifierStart(ch, cp) {
return ch === '$' ||
ch === '_' ||
IDS_Y(cp);
}
function isValidIdentifierContinue(ch, cp) {
return ch === '$' ||
ch === '_' ||
cp === 0x200C || // <ZWNJ>
cp === 0x200D || // <ZWJ>
IDC_Y(cp);
}
angular.module('ngParseExt', [])
.config(['$parseProvider', function($parseProvider) {
$parseProvider.setIdentifierFns(isValidIdentifierStart, isValidIdentifierContinue);
}])
.info({ angularVersion: '"NG_VERSION_FULL"' });