@angular-wave/angular.ts 0.0.2 → 0.0.5
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/dist/angular-ts.cjs.js +29 -96
- package/dist/angular-ts.esm.js +29 -96
- package/dist/angular-ts.umd.js +29 -96
- package/package.json +1 -4
- package/public/README.md +1 -0
- package/src/core/cache.js +2 -0
- package/src/core/compile.js +2 -1
- package/src/core/utils.js +8 -0
- package/src/directive/csp.md +2 -0
- package/src/directive/switch.js +5 -63
- package/src/directive/switch.md +66 -0
- package/src/jqLite.js +14 -33
- package/test/jqlite.spec.js +6 -17
- package/test/ng/compile.spec.js +6 -5
- package/test/original-test.html +1 -1
- package/dist/build/angular-mocks.js +0 -3757
- package/dist/build/angular-parse-ext.js +0 -1275
- package/dist/build/angular-resource.js +0 -911
- package/dist/build/angular-touch.js +0 -368
- /package/{dist/build → legacy}/angular-animate.js +0 -0
- /package/{dist/build → legacy}/angular-aria.js +0 -0
- /package/{dist/build → legacy}/angular-message-format.js +0 -0
- /package/{dist/build → legacy}/angular-messages.js +0 -0
- /package/{dist/build → legacy}/angular-route.js +0 -0
- /package/{dist/build → legacy}/angular-sanitize.js +0 -0
- /package/{dist/build → legacy}/angular.js +0 -0
package/test/jqlite.spec.js
CHANGED
|
@@ -4,6 +4,7 @@ import { createInjector } from "../src/injector";
|
|
|
4
4
|
import { publishExternalAPI } from "../src/public";
|
|
5
5
|
import { equals, forEach } from "../src/core/utils";
|
|
6
6
|
import { browserTrigger } from "./test-utils";
|
|
7
|
+
import { CACHE, EXPANDO } from "../src/core/cache";
|
|
7
8
|
|
|
8
9
|
describe("jqLite", () => {
|
|
9
10
|
let scope;
|
|
@@ -227,18 +228,6 @@ describe("jqLite", () => {
|
|
|
227
228
|
});
|
|
228
229
|
});
|
|
229
230
|
|
|
230
|
-
describe("_data", () => {
|
|
231
|
-
it("should provide access to the events present on the element", () => {
|
|
232
|
-
const element = jqLite("<i>foo</i>");
|
|
233
|
-
// TODO: REMOVE angular becomes TESTED
|
|
234
|
-
angular.element = jqLite;
|
|
235
|
-
expect(angular.element._data(element[0]).events).toBeUndefined();
|
|
236
|
-
|
|
237
|
-
element.on("click", () => {});
|
|
238
|
-
expect(angular.element._data(element[0]).events.click).toBeDefined();
|
|
239
|
-
});
|
|
240
|
-
});
|
|
241
|
-
|
|
242
231
|
describe("inheritedData", () => {
|
|
243
232
|
it("should retrieve data attached to the current element", () => {
|
|
244
233
|
const element = jqLite("<i>foo</i>");
|
|
@@ -540,7 +529,7 @@ describe("jqLite", () => {
|
|
|
540
529
|
|
|
541
530
|
it("should not break on cleanData(), if element has no data", () => {
|
|
542
531
|
const selected = jqLite([a, b, c]);
|
|
543
|
-
spyOn(
|
|
532
|
+
spyOn(CACHE, "get").and.returnValue(undefined);
|
|
544
533
|
expect(() => {
|
|
545
534
|
jqLite.cleanData(selected);
|
|
546
535
|
}).not.toThrow();
|
|
@@ -572,13 +561,13 @@ describe("jqLite", () => {
|
|
|
572
561
|
const node = document.createElement("div");
|
|
573
562
|
document.body.appendChild(node);
|
|
574
563
|
|
|
575
|
-
expect(
|
|
564
|
+
expect(CACHE.has(node[EXPANDO])).toBe(false);
|
|
576
565
|
expect(jqLite.data(node, "foo")).toBeUndefined();
|
|
577
|
-
expect(
|
|
566
|
+
expect(CACHE.has(node[EXPANDO])).toBe(false);
|
|
578
567
|
|
|
579
568
|
jqLite.data(node, "foo", "bar");
|
|
580
569
|
|
|
581
|
-
expect(
|
|
570
|
+
expect(CACHE.has(node[EXPANDO])).toBe(true);
|
|
582
571
|
expect(jqLite.data(node, "foo")).toBe("bar");
|
|
583
572
|
expect(jqLite(node).data("foo")).toBe("bar");
|
|
584
573
|
|
|
@@ -593,7 +582,7 @@ describe("jqLite", () => {
|
|
|
593
582
|
expect(jqLite.data(node, "bar")).toBeUndefined();
|
|
594
583
|
|
|
595
584
|
jqLite(node).remove();
|
|
596
|
-
expect(
|
|
585
|
+
expect(CACHE.has(node[EXPANDO])).toBe(false);
|
|
597
586
|
});
|
|
598
587
|
|
|
599
588
|
it("should emit $destroy event if element removed via remove()", function () {
|
package/test/ng/compile.spec.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { publishExternalAPI } from "../../src/public";
|
|
2
2
|
import { createInjector } from "../../src/injector";
|
|
3
|
-
import { dealoc,
|
|
3
|
+
import { dealoc, JQLite } from "../../src/jqLite";
|
|
4
4
|
import {
|
|
5
5
|
forEach,
|
|
6
6
|
isFunction,
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
isArray,
|
|
12
12
|
} from "../../src/core/utils";
|
|
13
13
|
import { countChildScopes, countWatchers } from "../../src/core/root-scope";
|
|
14
|
+
import { CACHE, EXPANDO } from "../../src/core/cache";
|
|
14
15
|
|
|
15
16
|
function isUnknownElement(el) {
|
|
16
17
|
return !!el.toString().match(/Unknown/);
|
|
@@ -13902,7 +13903,7 @@ describe("$compile", () => {
|
|
|
13902
13903
|
firstRepeatedElem = element.children(".ng-scope").eq(0);
|
|
13903
13904
|
|
|
13904
13905
|
expect(firstRepeatedElem.data("$scope")).toBeDefined();
|
|
13905
|
-
privateData =
|
|
13906
|
+
privateData = CACHE.get(firstRepeatedElem[0]);
|
|
13906
13907
|
expect(privateData.events).toBeDefined();
|
|
13907
13908
|
|
|
13908
13909
|
expect(privateData.events.click).toBeDefined();
|
|
@@ -13918,7 +13919,7 @@ describe("$compile", () => {
|
|
|
13918
13919
|
|
|
13919
13920
|
expect(destroyCount).toBe(2);
|
|
13920
13921
|
expect(firstRepeatedElem.data("$scope")).not.toBeDefined();
|
|
13921
|
-
privateData =
|
|
13922
|
+
privateData = CACHE.get(firstRepeatedElem[0]);
|
|
13922
13923
|
expect(privateData && privateData.events).not.toBeDefined();
|
|
13923
13924
|
}
|
|
13924
13925
|
|
|
@@ -17624,10 +17625,10 @@ describe("$compile", () => {
|
|
|
17624
17625
|
linkedElements.remove();
|
|
17625
17626
|
|
|
17626
17627
|
forEach(preCompiledChildren, (element, i) => {
|
|
17627
|
-
expect(
|
|
17628
|
+
expect(CACHE.has(element[EXPANDO])).toBe(false, `template#${i}`);
|
|
17628
17629
|
});
|
|
17629
17630
|
forEach(getAll(linkedElements), (element, i) => {
|
|
17630
|
-
expect(
|
|
17631
|
+
expect(CACHE.has(element[EXPANDO])).toBe(false, `linked#${i}`);
|
|
17631
17632
|
});
|
|
17632
17633
|
}
|
|
17633
17634
|
|