@angular-wave/angular.ts 0.0.47 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Makefile +3 -0
- package/README.md +1 -1
- package/css/angular.css +0 -6
- package/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/jsdoc.json +24 -0
- package/package.json +6 -2
- package/src/angular.spec.js +1 -2
- package/src/animations/animate-queue.js +0 -1
- package/src/animations/animation.js +1 -1
- package/src/animations/raf-scheduler.js +0 -1
- package/src/animations/shared.js +1 -1
- package/src/core/animate/animate.js +0 -1
- package/src/core/compile/compile.md +1 -1
- package/src/core/compile/compile.spec.js +49 -47
- package/src/core/location/location.spec.js +1 -1
- package/src/core/on.spec.js +7 -12
- package/src/core/parser/ast-type.js +22 -0
- package/src/core/parser/ast.js +426 -0
- package/src/core/parser/compiler.js +561 -0
- package/src/core/parser/interpreter.js +422 -0
- package/src/core/parser/lexer.js +345 -0
- package/src/core/parser/parse.js +23 -1984
- package/src/core/parser/parse.md +57 -0
- package/src/core/parser/parse.spec.js +2 -2
- package/src/core/parser/parser.js +45 -0
- package/src/core/parser/shared.js +228 -0
- package/src/core/prop.spec.js +4 -4
- package/src/core/q/q.spec.js +0 -1
- package/src/core/sce/sce.js +3 -6
- package/src/core/scope/scope.js +33 -21
- package/src/core/task-tracker-factory.js +0 -1
- package/src/directive/class/class.js +0 -2
- package/src/directive/form/form.js +0 -3
- package/src/directive/form/form.spec.js +18 -18
- package/src/directive/include/include.js +1 -1
- package/src/directive/include/include.spec.js +18 -19
- package/src/directive/input/input.js +1 -2
- package/src/directive/model/model.js +1 -3
- package/src/directive/model/model.spec.js +0 -1
- package/src/directive/repeat/repeat.spec.js +0 -2
- package/src/directive/switch/switch.spec.js +4 -4
- package/src/exts/aria/aria.js +0 -1
- package/src/filters/filter.spec.js +0 -1
- package/src/injector.js +1 -1
- package/src/injector.spec.js +0 -5
- package/src/loader.js +0 -5
- package/src/services/cookie-reader.js +0 -1
- package/src/services/http/http.spec.js +0 -2
- package/src/shared/constants.js +3 -2
- package/src/shared/utils.js +18 -7
- package/src/types.js +10 -0
- package/types/core/parser/ast-type.d.ts +20 -0
- package/types/core/parser/ast.d.ts +86 -0
- package/types/core/parser/compiler.d.ts +49 -0
- package/types/core/parser/interpreter.d.ts +57 -0
- package/types/core/parser/lexer.d.ts +153 -0
- package/types/core/parser/parse.d.ts +68 -0
- package/types/core/parser/parser.d.ts +28 -0
- package/types/core/parser/shared.d.ts +29 -0
- package/types/core/scope/scope.d.ts +19 -12
- package/types/shared/utils.d.ts +18 -5
- package/types/types.d.ts +1 -0
- package/types-back/index.d.ts +0 -12
package/jsdoc.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tags": {
|
|
3
|
+
"allowUnknownTags": false
|
|
4
|
+
},
|
|
5
|
+
"source": {
|
|
6
|
+
"include": "./src",
|
|
7
|
+
"includePattern": "\\.js$",
|
|
8
|
+
"excludePattern": "(node_modules/|docs|\\.spec.js$|\\.test.js$)"
|
|
9
|
+
},
|
|
10
|
+
"plugins": [
|
|
11
|
+
"plugins/markdown"
|
|
12
|
+
],
|
|
13
|
+
"opts": {
|
|
14
|
+
"template": "assets/template/docdash/",
|
|
15
|
+
"encoding": "utf8",
|
|
16
|
+
"destination": "docs/",
|
|
17
|
+
"recurse": true,
|
|
18
|
+
"verbose": true
|
|
19
|
+
},
|
|
20
|
+
"templates": {
|
|
21
|
+
"cleverLinks": false,
|
|
22
|
+
"monospaceLinks": false
|
|
23
|
+
}
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-wave/angular.ts",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.49",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/angular-ts.esm.js",
|
|
7
7
|
"browser": "dist/angular-ts.umd.js",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"dev": "vite",
|
|
18
18
|
"express": "node --watch ./utils/express.js",
|
|
19
19
|
"build": "vite build",
|
|
20
|
-
"playwright": "./node_modules/.bin/playwright test"
|
|
20
|
+
"playwright": "./node_modules/.bin/playwright test",
|
|
21
|
+
"generate-docs": "node_modules/.bin/jsdoc -c ./jsdoc.json"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"@playwright/test": "^1.44.0",
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
"@rollup/plugin-terser": "^0.4.4",
|
|
27
28
|
"@types/jasmine": "latest",
|
|
28
29
|
"@types/node": "latest",
|
|
30
|
+
"docdash": "^2.0.2",
|
|
29
31
|
"eslint": "latest",
|
|
30
32
|
"eslint-config-airbnb-base": "latest",
|
|
31
33
|
"eslint-config-prettier": "latest",
|
|
@@ -33,6 +35,8 @@
|
|
|
33
35
|
"eslint-plugin-promise": "latest",
|
|
34
36
|
"express": "latest",
|
|
35
37
|
"jasmine-core": "latest",
|
|
38
|
+
"jsdoc": "^4.0.3",
|
|
39
|
+
"jsdoc-to-markdown": "^8.0.1",
|
|
36
40
|
"npm-run-all": "latest",
|
|
37
41
|
"playwright": "^1.44.0",
|
|
38
42
|
"prettier": "latest",
|
package/src/angular.spec.js
CHANGED
|
@@ -884,9 +884,8 @@ describe("angular", () => {
|
|
|
884
884
|
merge(dst, src);
|
|
885
885
|
|
|
886
886
|
if (typeof dst.__proto__ !== "undefined") {
|
|
887
|
-
// eslint-disable-line
|
|
888
887
|
// Should not overwrite the __proto__ property or pollute the Object prototype
|
|
889
|
-
expect(dst.__proto__).toBe(Object.prototype);
|
|
888
|
+
expect(dst.__proto__).toBe(Object.prototype);
|
|
890
889
|
}
|
|
891
890
|
expect({}.xxx).toBeUndefined();
|
|
892
891
|
});
|
|
@@ -52,7 +52,7 @@ export function $$AnimationProvider() {
|
|
|
52
52
|
|
|
53
53
|
// this is done first beforehand so that the map
|
|
54
54
|
// is filled with a list of the elements that will be animated
|
|
55
|
-
|
|
55
|
+
|
|
56
56
|
for (i = 0; i < animations.length; i++) {
|
|
57
57
|
const animation = animations[i];
|
|
58
58
|
lookup.set(
|
package/src/animations/shared.js
CHANGED
|
@@ -96,7 +96,7 @@ export function packageStyles(options) {
|
|
|
96
96
|
|
|
97
97
|
export function pendClasses(classes, fix, isPrefix) {
|
|
98
98
|
let className = "";
|
|
99
|
-
|
|
99
|
+
|
|
100
100
|
classes = Array.isArray(classes)
|
|
101
101
|
? classes
|
|
102
102
|
: classes && isString(classes) && classes.length
|
|
@@ -827,7 +827,7 @@
|
|
|
827
827
|
- `link()` or `compile()` functions. It has a variety of uses.
|
|
828
828
|
-
|
|
829
829
|
- - _Accessing normalized attribute names:_ Directives like `ngBind` can be expressed in many ways:
|
|
830
|
-
- `
|
|
830
|
+
- `data-ng-bind`, or `ng-bind`. The attributes object allows for normalized access
|
|
831
831
|
- to the attributes.
|
|
832
832
|
-
|
|
833
833
|
- - _Directive inter-communication:_ All directives share the same instance of the attributes
|
|
@@ -296,8 +296,8 @@ describe("$compile", () => {
|
|
|
296
296
|
expect(el[0].childNodes[0].childNodes[0]).toBeTruthy();
|
|
297
297
|
});
|
|
298
298
|
|
|
299
|
-
["
|
|
300
|
-
["
|
|
299
|
+
["data"].forEach((prefix) => {
|
|
300
|
+
["-"].forEach((delim) => {
|
|
301
301
|
it(
|
|
302
302
|
"compiles element directives with " + prefix + delim + " prefix",
|
|
303
303
|
() => {
|
|
@@ -352,7 +352,7 @@ describe("$compile", () => {
|
|
|
352
352
|
};
|
|
353
353
|
});
|
|
354
354
|
reloadModules();
|
|
355
|
-
var el = $("<div
|
|
355
|
+
var el = $("<div my-directive></div>");
|
|
356
356
|
$compile(el);
|
|
357
357
|
expect(el.data("hasCompiled")).toBe(true);
|
|
358
358
|
});
|
|
@@ -717,7 +717,7 @@ describe("$compile", () => {
|
|
|
717
717
|
it("should allow multiple directives per element", () => {
|
|
718
718
|
reloadModules();
|
|
719
719
|
var el = $(
|
|
720
|
-
"<span greet='angular' log='L'
|
|
720
|
+
"<span greet='angular' log='L' high-log='H' data-medium-log='M'></span>",
|
|
721
721
|
);
|
|
722
722
|
$compile(el)($rootScope);
|
|
723
723
|
expect(el.text()).toEqual("Hello angular");
|
|
@@ -782,7 +782,7 @@ describe("$compile", () => {
|
|
|
782
782
|
|
|
783
783
|
reloadModules();
|
|
784
784
|
element = $compile(
|
|
785
|
-
'<div log exp="abc" aa="A"
|
|
785
|
+
'<div log exp="abc" aa="A" Bb="B" daTa-cC="C">unlinked</div>',
|
|
786
786
|
)($rootScope);
|
|
787
787
|
|
|
788
788
|
expect(element.text()).toEqual("worked");
|
|
@@ -963,10 +963,10 @@ describe("$compile", () => {
|
|
|
963
963
|
it("denormalizes attribute by using original attribute name", () => {
|
|
964
964
|
registerAndCompile(
|
|
965
965
|
"myDirective",
|
|
966
|
-
'<my-directive
|
|
966
|
+
'<my-directive some-attribute="42"></my-directive>',
|
|
967
967
|
function (element, attrs) {
|
|
968
968
|
attrs.$set("someAttribute", 43);
|
|
969
|
-
expect(element.attr("
|
|
969
|
+
expect(element.attr("some-attribute")).toEqual("43");
|
|
970
970
|
},
|
|
971
971
|
);
|
|
972
972
|
});
|
|
@@ -985,13 +985,12 @@ describe("$compile", () => {
|
|
|
985
985
|
it("uses new attribute name after once given", () => {
|
|
986
986
|
registerAndCompile(
|
|
987
987
|
"myDirective",
|
|
988
|
-
'<my-directive
|
|
988
|
+
'<my-directive some-attribute="42"></my-directive>',
|
|
989
989
|
function (element, attrs) {
|
|
990
990
|
attrs.$set("someAttribute", 43, true, "some-attribute");
|
|
991
991
|
attrs.$set("someAttribute", 44);
|
|
992
992
|
|
|
993
993
|
expect(element.attr("some-attribute")).toEqual("44");
|
|
994
|
-
expect(element.attr("x-some-attribute")).toEqual("42");
|
|
995
994
|
},
|
|
996
995
|
);
|
|
997
996
|
});
|
|
@@ -4696,9 +4695,9 @@ describe("$compile", () => {
|
|
|
4696
4695
|
},
|
|
4697
4696
|
}));
|
|
4698
4697
|
reloadModules();
|
|
4699
|
-
$compile("<div
|
|
4698
|
+
$compile("<div t></div>")($rootScope);
|
|
4700
4699
|
$compile("<div -t></div>")($rootScope);
|
|
4701
|
-
$compile("<div
|
|
4700
|
+
$compile("<div t></div>")($rootScope);
|
|
4702
4701
|
expect(log.join("; ")).toEqual("pre; post; pre; post; pre; post");
|
|
4703
4702
|
});
|
|
4704
4703
|
|
|
@@ -5164,7 +5163,7 @@ describe("$compile", () => {
|
|
|
5164
5163
|
registerDefaultDirectives();
|
|
5165
5164
|
reloadModules();
|
|
5166
5165
|
element = $compile(
|
|
5167
|
-
'<span log="L"
|
|
5166
|
+
'<span log="L" high-log="H" data-medium-log="M"></span>',
|
|
5168
5167
|
)($rootScope);
|
|
5169
5168
|
expect(log.join("; ")).toEqual("L; M; H");
|
|
5170
5169
|
});
|
|
@@ -7791,13 +7790,13 @@ describe("$compile", () => {
|
|
|
7791
7790
|
|
|
7792
7791
|
it("should translate {{}} in terminal nodes", () => {
|
|
7793
7792
|
element = $compile(
|
|
7794
|
-
'<select ng
|
|
7793
|
+
'<select ng-model="x"><option value="">Greet {{name}}!</option></select>',
|
|
7795
7794
|
)($rootScope);
|
|
7796
7795
|
$rootScope.$digest();
|
|
7797
7796
|
expect(
|
|
7798
7797
|
element[0].outerHTML.replace(' selected="selected"', ""),
|
|
7799
7798
|
).toEqual(
|
|
7800
|
-
'<select ng
|
|
7799
|
+
'<select ng-model="x" class="ng-pristine ng-untouched ng-valid ng-empty">' +
|
|
7801
7800
|
'<option value="">Greet !</option>' +
|
|
7802
7801
|
"</select>",
|
|
7803
7802
|
);
|
|
@@ -7806,7 +7805,7 @@ describe("$compile", () => {
|
|
|
7806
7805
|
expect(
|
|
7807
7806
|
element[0].outerHTML.replace(' selected="selected"', ""),
|
|
7808
7807
|
).toEqual(
|
|
7809
|
-
'<select ng
|
|
7808
|
+
'<select ng-model="x" class="ng-pristine ng-untouched ng-valid ng-empty">' +
|
|
7810
7809
|
'<option value="">Greet Misko!</option>' +
|
|
7811
7810
|
"</select>",
|
|
7812
7811
|
);
|
|
@@ -14256,7 +14255,7 @@ describe("$compile", () => {
|
|
|
14256
14255
|
beforeEach(() => {
|
|
14257
14256
|
module.directive("toggle", () => ({
|
|
14258
14257
|
transclude: true,
|
|
14259
|
-
template: '<div ng
|
|
14258
|
+
template: '<div ng-if="t"><div ng-transclude></div></div>',
|
|
14260
14259
|
}));
|
|
14261
14260
|
initInjector("test1");
|
|
14262
14261
|
});
|
|
@@ -14264,7 +14263,7 @@ describe("$compile", () => {
|
|
|
14264
14263
|
it("should not leak the transclude scope when the transcluded content is an element transclusion directive", () => {
|
|
14265
14264
|
element = $compile(
|
|
14266
14265
|
"<div toggle>" +
|
|
14267
|
-
"<div ng
|
|
14266
|
+
"<div ng-repeat=\"msg in ['msg-1']\">{{ msg }}</div>" +
|
|
14268
14267
|
"</div>",
|
|
14269
14268
|
)($rootScope);
|
|
14270
14269
|
|
|
@@ -14292,8 +14291,8 @@ describe("$compile", () => {
|
|
|
14292
14291
|
it("should not leak the transclude scope when the transcluded content is an multi-element transclusion directive", () => {
|
|
14293
14292
|
element = $compile(
|
|
14294
14293
|
"<div toggle>" +
|
|
14295
|
-
"<div ng
|
|
14296
|
-
"<div ng
|
|
14294
|
+
"<div ng-repeat-start=\"msg in ['msg-1']\">{{ msg }}</div>" +
|
|
14295
|
+
"<div ng-repeat-end>{{ msg }}</div>" +
|
|
14297
14296
|
"</div>",
|
|
14298
14297
|
)($rootScope);
|
|
14299
14298
|
|
|
@@ -14371,7 +14370,7 @@ describe("$compile", () => {
|
|
|
14371
14370
|
it("should mark as destroyed all sub scopes of the scope being destroyed", () => {
|
|
14372
14371
|
element = $compile(
|
|
14373
14372
|
"<div toggle>" +
|
|
14374
|
-
"<div ng
|
|
14373
|
+
"<div ng-repeat=\"msg in ['msg-1']\">{{ msg }}</div>" +
|
|
14375
14374
|
"</div>",
|
|
14376
14375
|
)($rootScope);
|
|
14377
14376
|
|
|
@@ -15362,7 +15361,7 @@ describe("$compile", () => {
|
|
|
15362
15361
|
transclude: {},
|
|
15363
15362
|
template:
|
|
15364
15363
|
'<div class="a" ng-transclude="ng-transclude"></div>' +
|
|
15365
|
-
'<div class="b" ng
|
|
15364
|
+
'<div class="b" ng-transclude="ng-transclude"></div>' +
|
|
15366
15365
|
'<div class="c" data-ng-transclude="data-ng-transclude"></div>',
|
|
15367
15366
|
}));
|
|
15368
15367
|
initInjector("test1");
|
|
@@ -15574,7 +15573,7 @@ describe("$compile", () => {
|
|
|
15574
15573
|
element = $compile(
|
|
15575
15574
|
"<foo>" +
|
|
15576
15575
|
"<foo-bar>bar1</foo-bar>" +
|
|
15577
|
-
"<foo
|
|
15576
|
+
"<foo-bar>bar2</foo-bar>" +
|
|
15578
15577
|
"<moo-kar>baz1</moo-kar>" +
|
|
15579
15578
|
"<data-moo-kar>baz2</data-moo-kar>" +
|
|
15580
15579
|
"</foo>",
|
|
@@ -16041,7 +16040,7 @@ describe("$compile", () => {
|
|
|
16041
16040
|
expect($$sanitizeUri).toHaveBeenCalledWith($rootScope.testUrl, false);
|
|
16042
16041
|
});
|
|
16043
16042
|
|
|
16044
|
-
it("should use $$sanitizeUri when working with svg and xlink
|
|
16043
|
+
it("should use $$sanitizeUri when working with svg and xlink-href", () => {
|
|
16045
16044
|
const $$sanitizeUri = jasmine
|
|
16046
16045
|
.createSpy("$$sanitizeUri")
|
|
16047
16046
|
.and.returnValue("https://clean.example.org");
|
|
@@ -16054,10 +16053,10 @@ describe("$compile", () => {
|
|
|
16054
16053
|
$rootScope.testUrl = "https://bad.example.org";
|
|
16055
16054
|
|
|
16056
16055
|
const elementA = $compile(
|
|
16057
|
-
"<svg><a xlink
|
|
16056
|
+
"<svg><a xlink-href=\"{{ testUrl + 'aTag' }}\"></a></svg>",
|
|
16058
16057
|
)($rootScope);
|
|
16059
16058
|
$rootScope.$apply();
|
|
16060
|
-
expect(elementA.find("a").attr("xlink
|
|
16059
|
+
expect(elementA.find("a").attr("xlink-href")).toBe(
|
|
16061
16060
|
"https://clean.example.org",
|
|
16062
16061
|
);
|
|
16063
16062
|
expect($$sanitizeUri).toHaveBeenCalledWith(
|
|
@@ -16066,10 +16065,10 @@ describe("$compile", () => {
|
|
|
16066
16065
|
);
|
|
16067
16066
|
|
|
16068
16067
|
const elementImage = $compile(
|
|
16069
|
-
"<svg><image xlink
|
|
16068
|
+
"<svg><image xlink-href=\"{{ testUrl + 'imageTag' }}\"></image></svg>",
|
|
16070
16069
|
)($rootScope);
|
|
16071
16070
|
$rootScope.$apply();
|
|
16072
|
-
expect(elementImage.find("image").attr("xlink
|
|
16071
|
+
expect(elementImage.find("image").attr("xlink-href")).toBe(
|
|
16073
16072
|
"https://clean.example.org",
|
|
16074
16073
|
);
|
|
16075
16074
|
expect($$sanitizeUri).toHaveBeenCalledWith(
|
|
@@ -16108,7 +16107,7 @@ describe("$compile", () => {
|
|
|
16108
16107
|
});
|
|
16109
16108
|
initInjector("test1");
|
|
16110
16109
|
element = $compile(
|
|
16111
|
-
'<svg><whatever xlink
|
|
16110
|
+
'<svg><whatever xlink-href="{{ testUrl }}"></whatever></svg>',
|
|
16112
16111
|
)($rootScope);
|
|
16113
16112
|
$rootScope.testUrl = "https://bad.example.org";
|
|
16114
16113
|
|
|
@@ -16481,7 +16480,7 @@ describe("$compile", () => {
|
|
|
16481
16480
|
it("should work with different prefixes", () => {
|
|
16482
16481
|
$rootScope.name = "Misko";
|
|
16483
16482
|
element = $compile(
|
|
16484
|
-
'<span ng
|
|
16483
|
+
'<span ng-attr-test="{{name}}" ng-Attr-test2="{{name}}" ng-Attr-test3="{{name}}"></span>',
|
|
16485
16484
|
)($rootScope);
|
|
16486
16485
|
expect(element.attr("test")).toBeUndefined();
|
|
16487
16486
|
expect(element.attr("test2")).toBeUndefined();
|
|
@@ -16535,10 +16534,10 @@ describe("$compile", () => {
|
|
|
16535
16534
|
expect(element.attr("href")).toBe("test/test");
|
|
16536
16535
|
});
|
|
16537
16536
|
|
|
16538
|
-
it("should work if they are prefixed with
|
|
16537
|
+
it("should work if they are prefixed with data- and different prefixes", () => {
|
|
16539
16538
|
$rootScope.name = "Misko";
|
|
16540
16539
|
element = $compile(
|
|
16541
|
-
'<span data-ng-attr-test2="{{name}}" ng-attr-test3="{{name}}" data-ng
|
|
16540
|
+
'<span data-ng-attr-test2="{{name}}" ng-attr-test3="{{name}}" data-ng-attr-test4="{{name}}" ' +
|
|
16542
16541
|
'ng-attr-test5="{{name}}" ng-attr-test6="{{name}}"></span>',
|
|
16543
16542
|
)($rootScope);
|
|
16544
16543
|
expect(element.attr("test2")).toBeUndefined();
|
|
@@ -16603,7 +16602,7 @@ describe("$compile", () => {
|
|
|
16603
16602
|
it("should work with different prefixes", () => {
|
|
16604
16603
|
$rootScope.name = "JamieMason";
|
|
16605
16604
|
element = $compile(
|
|
16606
|
-
'<span ng
|
|
16605
|
+
'<span ng-attr-dash-test="{{name}}" ng-Attr-dash-test2="{{name}}" ng-Attr-dash-test3="{{name}}"></span>',
|
|
16607
16606
|
)($rootScope);
|
|
16608
16607
|
expect(element.attr("dash-test")).toBeUndefined();
|
|
16609
16608
|
expect(element.attr("dash-test2")).toBeUndefined();
|
|
@@ -16614,10 +16613,10 @@ describe("$compile", () => {
|
|
|
16614
16613
|
expect(element.attr("dash-test3")).toBe("JamieMason");
|
|
16615
16614
|
});
|
|
16616
16615
|
|
|
16617
|
-
it("should work if they are prefixed with
|
|
16616
|
+
it("should work if they are prefixed with or data-", () => {
|
|
16618
16617
|
$rootScope.name = "JamieMason";
|
|
16619
16618
|
element = $compile(
|
|
16620
|
-
'<span data-ng-attr-dash-test2="{{name}}" ng-attr-dash-test3="{{name}}" data-ng
|
|
16619
|
+
'<span data-ng-attr-dash-test2="{{name}}" ng-attr-dash-test3="{{name}}" data-ng-attr-dash-test4="{{name}}"></span>',
|
|
16621
16620
|
)($rootScope);
|
|
16622
16621
|
expect(element.attr("dash-test2")).toBeUndefined();
|
|
16623
16622
|
expect(element.attr("dash-test3")).toBeUndefined();
|
|
@@ -16822,32 +16821,35 @@ describe("$compile", () => {
|
|
|
16822
16821
|
describe("when an attribute has an underscore-separated name", () => {
|
|
16823
16822
|
it("should work with different prefixes", () => {
|
|
16824
16823
|
$rootScope.dimensions = "0 0 0 0";
|
|
16825
|
-
element = $compile('<svg ng
|
|
16824
|
+
element = $compile('<svg ng-attr-view-box="{{dimensions}}"></svg>')(
|
|
16826
16825
|
$rootScope,
|
|
16827
16826
|
);
|
|
16828
|
-
expect(element.attr("
|
|
16827
|
+
expect(element.attr("view-box")).toBeUndefined();
|
|
16829
16828
|
$rootScope.$digest();
|
|
16830
|
-
expect(element.attr("
|
|
16829
|
+
expect(element.attr("view-box")).toBe("0 0 0 0");
|
|
16831
16830
|
});
|
|
16832
16831
|
|
|
16833
|
-
it("should work if they are prefixed with
|
|
16832
|
+
it("should work if they are prefixed with data-", () => {
|
|
16834
16833
|
$rootScope.dimensions = "0 0 0 0";
|
|
16835
16834
|
$rootScope.number = 0.42;
|
|
16836
16835
|
$rootScope.scale = 1;
|
|
16837
16836
|
element = $compile(
|
|
16838
|
-
'<svg data-ng-attr-
|
|
16839
|
-
'<filter ng-attr-
|
|
16840
|
-
'<feDiffuseLighting data-ng
|
|
16837
|
+
'<svg data-ng-attr-view-box="{{dimensions}}">' +
|
|
16838
|
+
'<filter ng-attr-filter-units="{{number}}">' +
|
|
16839
|
+
'<feDiffuseLighting data-ng-attr-surface-scale="{{scale}}">' +
|
|
16841
16840
|
"</feDiffuseLighting>" +
|
|
16842
|
-
'<feSpecularLighting
|
|
16841
|
+
'<feSpecularLighting ng-attr-surface-scale="{{scale}}">' +
|
|
16843
16842
|
"</feSpecularLighting></filter></svg>",
|
|
16844
16843
|
)($rootScope);
|
|
16845
16844
|
expect(element.attr("viewBox")).toBeUndefined();
|
|
16846
16845
|
$rootScope.$digest();
|
|
16847
|
-
|
|
16848
|
-
expect(element.
|
|
16849
|
-
expect(element.find("
|
|
16850
|
-
expect(element.find("
|
|
16846
|
+
|
|
16847
|
+
expect(element.attr("view-box")).toBe("0 0 0 0");
|
|
16848
|
+
expect(element.find("filter").attr("filter-units")).toBe("0.42");
|
|
16849
|
+
expect(element.find("feDiffuseLighting").attr("surface-scale")).toBe("1");
|
|
16850
|
+
expect(element.find("feSpecularLighting").attr("surface-scale")).toBe(
|
|
16851
|
+
"1",
|
|
16852
|
+
);
|
|
16851
16853
|
});
|
|
16852
16854
|
});
|
|
16853
16855
|
|
|
@@ -17163,7 +17165,7 @@ describe("$compile", () => {
|
|
|
17163
17165
|
}).toThrowError(/uterdir/);
|
|
17164
17166
|
});
|
|
17165
17167
|
|
|
17166
|
-
it("should support data-
|
|
17168
|
+
it("should support data- prefix", () => {
|
|
17167
17169
|
$rootScope.show = false;
|
|
17168
17170
|
element = $compile(
|
|
17169
17171
|
"<div>" +
|
|
@@ -3233,7 +3233,7 @@ describe("$location", () => {
|
|
|
3233
3233
|
expect(
|
|
3234
3234
|
parseLinkAndReturn(locationUrl, "http://server/pre/#otherPath"),
|
|
3235
3235
|
).toEqual("http://server/pre/#/otherPath");
|
|
3236
|
-
|
|
3236
|
+
|
|
3237
3237
|
expect(parseLinkAndReturn(locationUrl, "javascript:void(0)")).toEqual(
|
|
3238
3238
|
undefined,
|
|
3239
3239
|
);
|
package/src/core/on.spec.js
CHANGED
|
@@ -63,7 +63,7 @@ describe("ngOn* event binding", () => {
|
|
|
63
63
|
it("should work with different prefixes", () => {
|
|
64
64
|
const cb = ($rootScope.cb = jasmine.createSpy("ng-on cb"));
|
|
65
65
|
const element = $compile(
|
|
66
|
-
'<span ng
|
|
66
|
+
'<span ng-on-test="cb(1)" ng-On-test2="cb(2)"></span>',
|
|
67
67
|
)($rootScope);
|
|
68
68
|
|
|
69
69
|
element.triggerHandler("test");
|
|
@@ -71,15 +71,12 @@ describe("ngOn* event binding", () => {
|
|
|
71
71
|
|
|
72
72
|
element.triggerHandler("test2");
|
|
73
73
|
expect(cb).toHaveBeenCalledWith(2);
|
|
74
|
-
|
|
75
|
-
element.triggerHandler("test3");
|
|
76
|
-
expect(cb).toHaveBeenCalledWith(3);
|
|
77
74
|
});
|
|
78
75
|
|
|
79
|
-
it("should work if they are prefixed with
|
|
76
|
+
it("should work if they are prefixed with data- and different prefixes", () => {
|
|
80
77
|
const cb = ($rootScope.cb = jasmine.createSpy("ng-on cb"));
|
|
81
78
|
const element = $compile(
|
|
82
|
-
'<span data-ng-on-test2="cb(2)" ng-on-test3="cb(3)" data-ng
|
|
79
|
+
'<span data-ng-on-test2="cb(2)" ng-on-test3="cb(3)" data-ng-on-test4="cb(4)" ' +
|
|
83
80
|
'ng-on-test5="cb(5)" ng-on-test6="cb(6)"></span>',
|
|
84
81
|
)($rootScope);
|
|
85
82
|
|
|
@@ -151,7 +148,7 @@ describe("ngOn* event binding", () => {
|
|
|
151
148
|
$rootScope = injector.get("$rootScope");
|
|
152
149
|
$compile = injector.get("$compile");
|
|
153
150
|
$compile(
|
|
154
|
-
'<div attr-exposer ng-on-title="cb(1)" ng-on-super-title="cb(2)" ng-on-my-
|
|
151
|
+
'<div attr-exposer ng-on-title="cb(1)" ng-on-super-title="cb(2)" ng-on-my-camel-title="cb(3)">',
|
|
155
152
|
)($rootScope);
|
|
156
153
|
|
|
157
154
|
expect(attrs.title).toBeUndefined();
|
|
@@ -167,7 +164,7 @@ describe("ngOn* event binding", () => {
|
|
|
167
164
|
expect(attrs.myCamelTitle).toBeUndefined();
|
|
168
165
|
expect(attrs.$attr.myCamelTitle).toBeUndefined();
|
|
169
166
|
expect(attrs.ngOnMyCamelTitle).toBe("cb(3)");
|
|
170
|
-
expect(attrs.$attr.ngOnMyCamelTitle).toBe("ng-on-my-
|
|
167
|
+
expect(attrs.$attr.ngOnMyCamelTitle).toBe("ng-on-my-camel-title");
|
|
171
168
|
});
|
|
172
169
|
|
|
173
170
|
it("should not conflict with (ng-attr-)attribute mappings of the same name", () => {
|
|
@@ -204,8 +201,6 @@ describe("ngOn* event binding", () => {
|
|
|
204
201
|
|
|
205
202
|
element.triggerHandler("foobar");
|
|
206
203
|
element.triggerHandler("fooBar");
|
|
207
|
-
element.triggerHandler("foo_bar");
|
|
208
|
-
element.triggerHandler("foo:bar");
|
|
209
204
|
expect(cb).not.toHaveBeenCalled();
|
|
210
205
|
|
|
211
206
|
element.triggerHandler("foo-bar");
|
|
@@ -219,8 +214,8 @@ describe("ngOn* event binding", () => {
|
|
|
219
214
|
|
|
220
215
|
element.triggerHandler("foobar");
|
|
221
216
|
element.triggerHandler("foo-bar");
|
|
222
|
-
element.triggerHandler("
|
|
223
|
-
element.triggerHandler("foo
|
|
217
|
+
element.triggerHandler("foo-bar");
|
|
218
|
+
element.triggerHandler("foo-bar");
|
|
224
219
|
expect(cb).not.toHaveBeenCalled();
|
|
225
220
|
|
|
226
221
|
element.triggerHandler("fooBar");
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {("Program"|"ExpressionStatement"|"AssignmentExpression"|"ConditionalExpression"|"LogicalExpression"|"BinaryExpression"|"UnaryExpression"|"CallExpression"|"MemberExpression"|"Identifier"|"Literal"|"ArrayExpression"|"Property"|"ObjectExpression"|"ThisExpression"|"LocalsExpression"|"NGValueParameter")} ASTType
|
|
3
|
+
*/
|
|
4
|
+
export const ASTType = {
|
|
5
|
+
Program: "Program",
|
|
6
|
+
ExpressionStatement: "ExpressionStatement",
|
|
7
|
+
AssignmentExpression: "AssignmentExpression",
|
|
8
|
+
ConditionalExpression: "ConditionalExpression",
|
|
9
|
+
LogicalExpression: "LogicalExpression",
|
|
10
|
+
BinaryExpression: "BinaryExpression",
|
|
11
|
+
UnaryExpression: "UnaryExpression",
|
|
12
|
+
CallExpression: "CallExpression",
|
|
13
|
+
MemberExpression: "MemberExpression",
|
|
14
|
+
Identifier: "Identifier",
|
|
15
|
+
Literal: "Literal",
|
|
16
|
+
ArrayExpression: "ArrayExpression",
|
|
17
|
+
Property: "Property",
|
|
18
|
+
ObjectExpression: "ObjectExpression",
|
|
19
|
+
ThisExpression: "ThisExpression",
|
|
20
|
+
LocalsExpression: "LocalsExpression",
|
|
21
|
+
NGValueParameter: "NGValueParameter",
|
|
22
|
+
};
|