@angular-wave/angular.ts 0.6.3 → 0.6.4
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.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/package.json +1 -1
- package/src/angular.spec.js +2 -2
- package/src/animations/animate-children-directive.js +1 -1
- package/src/animations/animate-css-driver.js +2 -2
- package/src/animations/animate-css.js +1 -1
- package/src/animations/animate-js.js +1 -1
- package/src/animations/animate-queue.js +2 -2
- package/src/animations/animate.js +2 -2
- package/src/animations/animate.spec.js +3 -3
- package/src/animations/animation.js +2 -2
- package/src/binding.spec.js +1 -1
- package/src/core/cache/cache.js +1 -1
- package/src/core/compile/attributes.js +3 -3
- package/src/core/compile/compile.js +13 -140
- package/src/core/compile/compile.md +0 -8
- package/src/core/compile/compile.spec.js +35 -639
- package/src/core/controller/controller.js +1 -1
- package/src/core/di/injector.js +1 -1
- package/src/core/di/injector.spec.js +1 -1
- package/src/core/di/internal-injector.js +1 -1
- package/src/core/di/ng-module.js +1 -1
- package/src/core/filter/filter.js +1 -1
- package/src/core/interpolate/interpolate.js +1 -1
- package/src/core/interval/interval-factory.js +1 -1
- package/src/core/interval/interval.js +1 -1
- package/src/core/location/location.js +3 -3
- package/src/core/on.spec.js +1 -1
- package/src/core/parse/interpreter.js +1 -1
- package/src/core/prop.spec.js +2 -2
- package/src/core/q/q.js +1 -1
- package/src/core/root-element.spec.js +1 -1
- package/src/core/sanitize/sanitize-uri.js +1 -1
- package/src/core/sce/sce.js +2 -2
- package/src/core/sce/sce.spec.js +1 -1
- package/src/core/scope/scope.js +1 -1
- package/src/core/scope/scope.spec.js +1 -1
- package/src/core/timeout/timeout.js +1 -1
- package/src/core/url-utils/url-utils.js +1 -1
- package/src/directive/aria/aria.js +1 -1
- package/src/directive/aria/aria.spec.js +1 -1
- package/src/directive/attrs/attrs.js +3 -3
- package/src/directive/attrs/attrs.spec.js +1 -1
- package/src/directive/attrs/boolean.spec.js +1 -1
- package/src/directive/attrs/element-style.spec.js +1 -1
- package/src/directive/attrs/src.spec.js +1 -1
- package/src/directive/bind/bind.js +1 -1
- package/src/directive/bind/bind.spec.js +1 -1
- package/src/directive/bind/bing-html.spec.js +1 -1
- package/src/directive/change/change.spec.js +1 -1
- package/src/directive/class/class.js +1 -1
- package/src/directive/class/class.spec.js +2 -2
- package/src/directive/cloak/cloak.spec.js +1 -1
- package/src/directive/controller/controller.spec.js +2 -2
- package/src/directive/events/click.spec.js +1 -1
- package/src/directive/events/event.spec.js +1 -1
- package/src/directive/events/events.js +2 -2
- package/src/directive/form/form.js +2 -2
- package/src/directive/form/form.spec.js +1 -1
- package/src/directive/if/if.js +2 -3
- package/src/directive/if/if.md +0 -1
- package/src/directive/if/if.spec.js +2 -2
- package/src/directive/include/include.js +3 -3
- package/src/directive/include/include.spec.js +2 -2
- package/src/directive/init/init.spec.js +1 -1
- package/src/directive/input/input.js +1 -1
- package/src/directive/input/input.spec.js +1 -1
- package/src/directive/messages/messages.js +1 -1
- package/src/directive/messages/messages.spec.js +3 -3
- package/src/directive/model/model.js +6 -6
- package/src/directive/model/model.spec.js +2 -2
- package/src/directive/model-options/model-options.js +1 -1
- package/src/directive/model-options/model-options.spec.js +2 -2
- package/src/directive/non-bindable/non-bindable.spec.js +1 -1
- package/src/directive/observe/observe.spec.js +1 -1
- package/src/directive/options/options.js +6 -2
- package/src/directive/options/options.spec.js +2 -2
- package/src/directive/ref/href.spec.js +2 -2
- package/src/directive/ref/ref.js +1 -1
- package/src/directive/repeat/repeat.js +263 -255
- package/src/directive/repeat/repeat.md +0 -22
- package/src/directive/repeat/repeat.spec.js +2 -115
- package/src/directive/script/script.spec.js +1 -1
- package/src/directive/select/select.js +2 -2
- package/src/directive/select/select.spec.js +2 -2
- package/src/directive/show-hide/show-hide.js +1 -3
- package/src/directive/show-hide/show-hide.md +0 -2
- package/src/directive/show-hide/show-hide.spec.js +1 -1
- package/src/directive/style/style.spec.js +1 -1
- package/src/directive/switch/switch.js +2 -4
- package/src/directive/switch/switch.spec.js +1 -51
- package/src/directive/transclude/transclude.js +2 -2
- package/src/directive/validators/validators.js +2 -2
- package/src/directive/validators/validators.spec.js +1 -1
- package/src/filters/filter.js +1 -1
- package/src/filters/filter.spec.js +2 -2
- package/src/filters/filters.js +1 -1
- package/src/filters/filters.spec.js +1 -1
- package/src/filters/limit-to.js +1 -1
- package/src/filters/limit-to.spec.js +1 -1
- package/src/filters/order-by.js +1 -1
- package/src/index.js +3 -9
- package/src/loader.js +10 -5
- package/src/router/common/trace.js +1 -1
- package/src/router/directives/state-directives.js +1 -1
- package/src/router/directives/state-directives.spec.js +1 -1
- package/src/router/directives/view-directive.js +2 -2
- package/src/router/directives/view-directive.spec.js +1 -1
- package/src/router/hooks/redirect-to.js +1 -1
- package/src/router/params/param-type.js +1 -1
- package/src/router/params/param-types.js +1 -1
- package/src/router/params/param.js +1 -1
- package/src/router/resolve/resolvable.js +1 -1
- package/src/router/resolve/resolve-context.js +1 -1
- package/src/router/state/state-builder.js +1 -1
- package/src/router/state/state-matcher.js +1 -1
- package/src/router/state/state-object.js +1 -1
- package/src/router/state/state-queue-manager.js +1 -1
- package/src/router/state/state-registry.js +1 -1
- package/src/router/state/state-service.js +1 -1
- package/src/router/state/state.spec.js +2 -2
- package/src/router/state/target-state.js +1 -1
- package/src/router/state/views.js +1 -1
- package/src/router/state-provider.js +1 -1
- package/src/router/template-factory.js +1 -1
- package/src/router/template-factory.spec.js +1 -1
- package/src/router/transition/hook-registry.js +1 -1
- package/src/router/transition/transition-service.js +1 -1
- package/src/router/transition/transition.js +1 -1
- package/src/router/url/url-config.js +1 -1
- package/src/router/url/url-matcher.js +1 -1
- package/src/router/url/url-rule.js +1 -1
- package/src/router/url/url-rules.js +1 -1
- package/src/router/url/url-service.js +6 -1
- package/src/router/url/url-service.spec.js +1 -1
- package/src/router/view/view.spec.js +1 -1
- package/src/router/view-hook.spec.js +1 -1
- package/src/router/view-scroll.spec.js +1 -1
- package/src/services/anchor-scroll.js +1 -1
- package/src/services/browser.js +2 -2
- package/src/services/cookie-reader.js +1 -1
- package/src/services/http/http.js +2 -2
- package/src/services/http/http.spec.js +1 -1
- package/src/services/http-backend/http-backend.js +1 -1
- package/src/services/log.js +1 -1
- package/src/services/template-request.js +1 -1
- package/src/shared/common.js +1 -1
- package/src/shared/jqlite/jqlite.js +9 -9
- package/src/shared/jqlite/jqlite.spec.js +11 -11
- package/src/shared/min-err.spec.js +6 -1
- package/src/shared/predicates.js +1 -1
- package/src/shared/strings.js +1 -1
- package/src/shared/test-utils.js +1 -1
- package/src/shared/utils.js +1 -1
- package/src/shared/utils.spec.js +1 -1
- package/src/types.js +0 -2
- package/types/animations/animate-css-driver.d.ts +1 -1
- package/types/animations/animate.d.ts +1 -1
- package/types/core/cache/cache.d.ts +1 -1
- package/types/core/compile/attributes.d.ts +2 -2
- package/types/core/compile/compile.d.ts +1 -1
- package/types/core/location/location.d.ts +1 -1
- package/types/directive/model/model.d.ts +1 -1
- package/types/directive/repeat/repeat.d.ts +0 -1
- package/types/loader.d.ts +2 -0
- package/types/services/browser.d.ts +1 -1
- package/types/shared/jqlite/jqlite.d.ts +1 -1
- package/types/shared/test-utils.d.ts +1 -1
- package/types/types.d.ts +1 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Angular } from "../../loader";
|
|
2
|
-
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
3
|
-
import { valueFn } from "../../shared/utils";
|
|
2
|
+
import { dealoc, JQLite } from "../../shared/jqlite/jqlite.js";
|
|
3
|
+
import { valueFn } from "../../shared/utils.js";
|
|
4
4
|
|
|
5
5
|
describe("ngRepeat", () => {
|
|
6
6
|
let element;
|
|
@@ -1066,76 +1066,6 @@ describe("ngRepeat", () => {
|
|
|
1066
1066
|
done();
|
|
1067
1067
|
}, 300);
|
|
1068
1068
|
});
|
|
1069
|
-
|
|
1070
|
-
it("should remove whole block even if the number of elements inside it changes", () => {
|
|
1071
|
-
scope.values = [1, 2, 3];
|
|
1072
|
-
|
|
1073
|
-
element = $compile(
|
|
1074
|
-
"<div>" +
|
|
1075
|
-
'<div ng-repeat-start="val in values"></div>' +
|
|
1076
|
-
"<span>{{val}}</span>" +
|
|
1077
|
-
"<p ng-repeat-end></p>" +
|
|
1078
|
-
"</div>",
|
|
1079
|
-
)(scope);
|
|
1080
|
-
|
|
1081
|
-
scope.$digest();
|
|
1082
|
-
|
|
1083
|
-
const ends = element.find("p");
|
|
1084
|
-
expect(ends.length).toBe(3);
|
|
1085
|
-
|
|
1086
|
-
// insert an extra element inside the second block
|
|
1087
|
-
const extra = JQLite("<strong></strong>")[0];
|
|
1088
|
-
element[0].insertBefore(extra, ends[1]);
|
|
1089
|
-
|
|
1090
|
-
scope.values.splice(1, 1);
|
|
1091
|
-
scope.$digest();
|
|
1092
|
-
|
|
1093
|
-
// expect the strong tag to be removed too
|
|
1094
|
-
expect(
|
|
1095
|
-
Array.from(element[0].children).map((x) => x.tagName.toLowerCase()),
|
|
1096
|
-
).toEqual(["div", "span", "p", "div", "span", "p"]);
|
|
1097
|
-
});
|
|
1098
|
-
|
|
1099
|
-
it("should move whole block even if the number of elements inside it changes", () => {
|
|
1100
|
-
scope.values = [1, 2, 3];
|
|
1101
|
-
|
|
1102
|
-
element = $compile(
|
|
1103
|
-
"<div>" +
|
|
1104
|
-
'<div ng-repeat-start="val in values"></div>' +
|
|
1105
|
-
"<span>{{val}}</span>" +
|
|
1106
|
-
"<p ng-repeat-end></p>" +
|
|
1107
|
-
"</div>",
|
|
1108
|
-
)(scope);
|
|
1109
|
-
|
|
1110
|
-
scope.$digest();
|
|
1111
|
-
|
|
1112
|
-
const ends = element.find("p");
|
|
1113
|
-
expect(ends.length).toBe(3);
|
|
1114
|
-
|
|
1115
|
-
// insert an extra element inside the third block
|
|
1116
|
-
const extra = JQLite("<strong></strong>")[0];
|
|
1117
|
-
element[0].insertBefore(extra, ends[2]);
|
|
1118
|
-
|
|
1119
|
-
// move the third block to the beginning
|
|
1120
|
-
scope.values.unshift(scope.values.pop());
|
|
1121
|
-
scope.$digest();
|
|
1122
|
-
|
|
1123
|
-
// expect the strong tag to be moved too
|
|
1124
|
-
expect(
|
|
1125
|
-
Array.from(element[0].children).map((x) => x.tagName.toLowerCase()),
|
|
1126
|
-
).toEqual([
|
|
1127
|
-
"div",
|
|
1128
|
-
"span",
|
|
1129
|
-
"strong",
|
|
1130
|
-
"p",
|
|
1131
|
-
"div",
|
|
1132
|
-
"span",
|
|
1133
|
-
"p",
|
|
1134
|
-
"div",
|
|
1135
|
-
"span",
|
|
1136
|
-
"p",
|
|
1137
|
-
]);
|
|
1138
|
-
});
|
|
1139
1069
|
});
|
|
1140
1070
|
|
|
1141
1071
|
describe("stability", () => {
|
|
@@ -1302,49 +1232,6 @@ describe("ngRepeat", () => {
|
|
|
1302
1232
|
});
|
|
1303
1233
|
});
|
|
1304
1234
|
|
|
1305
|
-
describe("ngRepeatStart", () => {
|
|
1306
|
-
it("should grow multi-node repeater", () => {
|
|
1307
|
-
scope.show = false;
|
|
1308
|
-
scope.books = [
|
|
1309
|
-
{ title: "T1", description: "D1" },
|
|
1310
|
-
{ title: "T2", description: "D2" },
|
|
1311
|
-
];
|
|
1312
|
-
element = $compile(
|
|
1313
|
-
"<div>" +
|
|
1314
|
-
'<dt ng-repeat-start="book in books">{{book.title}}:</dt>' +
|
|
1315
|
-
"<dd ng-repeat-end>{{book.description}};</dd>" +
|
|
1316
|
-
"</div>",
|
|
1317
|
-
)(scope);
|
|
1318
|
-
|
|
1319
|
-
scope.$digest();
|
|
1320
|
-
expect(element.text()).toEqual("T1:D1;T2:D2;");
|
|
1321
|
-
scope.books.push({ title: "T3", description: "D3" });
|
|
1322
|
-
scope.$digest();
|
|
1323
|
-
expect(element.text()).toEqual("T1:D1;T2:D2;T3:D3;");
|
|
1324
|
-
});
|
|
1325
|
-
|
|
1326
|
-
it("should not clobber ng-if when updating collection", () => {
|
|
1327
|
-
scope.values = [1, 2, 3];
|
|
1328
|
-
scope.showMe = true;
|
|
1329
|
-
|
|
1330
|
-
element = $compile(
|
|
1331
|
-
"<div>" +
|
|
1332
|
-
'<div ng-repeat-start="val in values">val:{{val}};</div>' +
|
|
1333
|
-
'<div ng-if="showMe" ng-repeat-end>if:{{val}};</div>' +
|
|
1334
|
-
"</div>",
|
|
1335
|
-
)(scope);
|
|
1336
|
-
|
|
1337
|
-
scope.$digest();
|
|
1338
|
-
expect(element.find("div").length).toBe(6);
|
|
1339
|
-
scope.values.shift();
|
|
1340
|
-
scope.values.push(4);
|
|
1341
|
-
|
|
1342
|
-
scope.$digest();
|
|
1343
|
-
expect(element.find("div").length).toBe(6);
|
|
1344
|
-
expect(element.text()).not.toContain("if:1;");
|
|
1345
|
-
});
|
|
1346
|
-
});
|
|
1347
|
-
|
|
1348
1235
|
describe("ngRepeat and transcludes", () => {
|
|
1349
1236
|
it("should allow access to directive controller from children when used in a replace template", () => {
|
|
1350
1237
|
let controller;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Angular } from "../../loader";
|
|
2
2
|
import { createInjector } from "../../core/di/injector";
|
|
3
|
-
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
3
|
+
import { dealoc, JQLite } from "../../shared/jqlite/jqlite.js";
|
|
4
4
|
|
|
5
5
|
describe("scriptDirective", () => {
|
|
6
6
|
let $rootScope;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JQLite } from "../../shared/jqlite/jqlite";
|
|
1
|
+
import { JQLite } from "../../shared/jqlite/jqlite.js";
|
|
2
2
|
import {
|
|
3
3
|
assertNotHasOwnProperty,
|
|
4
4
|
equals,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
includes,
|
|
7
7
|
isDefined,
|
|
8
8
|
shallowCopy,
|
|
9
|
-
} from "../../shared/utils";
|
|
9
|
+
} from "../../shared/utils.js";
|
|
10
10
|
|
|
11
11
|
function setOptionSelectedStatus(optionEl, value) {
|
|
12
12
|
optionEl[0].selected = value;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Angular } from "../../loader";
|
|
2
|
-
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
3
|
-
import { hashKey, equals, isNumberNaN } from "../../shared/utils";
|
|
2
|
+
import { dealoc, JQLite } from "../../shared/jqlite/jqlite.js";
|
|
3
|
+
import { hashKey, equals, isNumberNaN } from "../../shared/utils.js";
|
|
4
4
|
import { browserTrigger } from "../../shared/test-utils";
|
|
5
5
|
|
|
6
6
|
describe("select", () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hasAnimate } from "../../shared/utils";
|
|
1
|
+
import { hasAnimate } from "../../shared/utils.js";
|
|
2
2
|
|
|
3
3
|
const NG_HIDE_CLASS = "ng-hide";
|
|
4
4
|
const NG_HIDE_IN_PROGRESS_CLASS = "ng-hide-animate";
|
|
@@ -10,7 +10,6 @@ ngShowDirective.$inject = ["$animate"];
|
|
|
10
10
|
export function ngShowDirective($animate) {
|
|
11
11
|
return {
|
|
12
12
|
restrict: "A",
|
|
13
|
-
multiElement: true,
|
|
14
13
|
link(scope, element, attr) {
|
|
15
14
|
scope.$watch(attr.ngShow, (value) => {
|
|
16
15
|
// we're adding a temporary, animation-specific class for ng-hide since this way
|
|
@@ -46,7 +45,6 @@ ngHideDirective.$inject = ["$animate"];
|
|
|
46
45
|
export function ngHideDirective($animate) {
|
|
47
46
|
return {
|
|
48
47
|
restrict: "A",
|
|
49
|
-
multiElement: true,
|
|
50
48
|
link(scope, element, attr) {
|
|
51
49
|
scope.$watch(attr.ngHide, (value) => {
|
|
52
50
|
// The comment inside of the ngShowDirective explains why we add and
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
- @ngdoc directive
|
|
4
4
|
- @name ngShow
|
|
5
|
-
- @multiElement
|
|
6
5
|
-
|
|
7
6
|
- @description
|
|
8
7
|
- The `ngShow` directive shows or hides the given HTML element based on the expression provided to
|
|
@@ -133,7 +132,6 @@
|
|
|
133
132
|
|
|
134
133
|
- @ngdoc directive
|
|
135
134
|
- @name ngHide
|
|
136
|
-
- @multiElement
|
|
137
135
|
-
|
|
138
136
|
- @description
|
|
139
137
|
- The `ngHide` directive shows or hides the given HTML element based on the expression provided to
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Angular } from "../../loader";
|
|
2
2
|
import { createInjector } from "../../core/di/injector";
|
|
3
|
-
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
3
|
+
import { dealoc, JQLite } from "../../shared/jqlite/jqlite.js";
|
|
4
4
|
|
|
5
5
|
describe("ngShow / ngHide", () => {
|
|
6
6
|
let $scope;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Angular } from "../../loader";
|
|
2
2
|
import { createInjector } from "../../core/di/injector";
|
|
3
|
-
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
3
|
+
import { dealoc, JQLite } from "../../shared/jqlite/jqlite.js";
|
|
4
4
|
|
|
5
5
|
describe("ng-style", () => {
|
|
6
6
|
let $scope;
|
|
@@ -60,8 +60,8 @@ export function ngSwitchDirective($animate) {
|
|
|
60
60
|
|
|
61
61
|
if (
|
|
62
62
|
(selectedTranscludes =
|
|
63
|
-
ngSwitchController[
|
|
64
|
-
ngSwitchController[
|
|
63
|
+
ngSwitchController["cases"][`!${value}`] ||
|
|
64
|
+
ngSwitchController["cases"]["?"])
|
|
65
65
|
) {
|
|
66
66
|
Object.values(selectedTranscludes).forEach((selectedTransclude) => {
|
|
67
67
|
selectedTransclude.transclude((caseElement, selectedScope) => {
|
|
@@ -93,7 +93,6 @@ export function ngSwitchWhenDirective() {
|
|
|
93
93
|
priority: 1200,
|
|
94
94
|
restrict: "EA",
|
|
95
95
|
require: "^ngSwitch",
|
|
96
|
-
multiElement: true,
|
|
97
96
|
link(scope, element, attrs, ctrl, $transclude) {
|
|
98
97
|
const cases = attrs.ngSwitchWhen
|
|
99
98
|
.split(attrs.ngSwitchWhenSeparator)
|
|
@@ -123,7 +122,6 @@ export function ngSwitchDefaultDirective() {
|
|
|
123
122
|
transclude: "element",
|
|
124
123
|
priority: 1200,
|
|
125
124
|
require: "^ngSwitch",
|
|
126
|
-
multiElement: true,
|
|
127
125
|
link(_scope, element, _attr, ctrl, $transclude) {
|
|
128
126
|
ctrl["cases"]["?"] = ctrl["cases"]["?"] || [];
|
|
129
127
|
ctrl["cases"]["?"].push({ transclude: $transclude, element });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Angular } from "../../loader";
|
|
2
|
-
import { dealoc } from "../../shared/jqlite/jqlite";
|
|
2
|
+
import { dealoc } from "../../shared/jqlite/jqlite.js";
|
|
3
3
|
|
|
4
4
|
describe("ngSwitch", () => {
|
|
5
5
|
let $scope;
|
|
@@ -79,31 +79,6 @@ describe("ngSwitch", () => {
|
|
|
79
79
|
expect(element.text()).toEqual("true:misko");
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
-
it("should show all elements between start and end markers that match the current value", () => {
|
|
83
|
-
element = $compile(
|
|
84
|
-
'<ul ng-switch="select">' +
|
|
85
|
-
'<li ng-switch-when-start="1">A</li>' +
|
|
86
|
-
"<li>B</li>" +
|
|
87
|
-
"<li ng-switch-when-end>C</li>" +
|
|
88
|
-
'<li ng-switch-when-start="2">D</li>' +
|
|
89
|
-
"<li>E</li>" +
|
|
90
|
-
"<li ng-switch-when-end>F</li>" +
|
|
91
|
-
"</ul>",
|
|
92
|
-
)($scope);
|
|
93
|
-
|
|
94
|
-
$scope.$apply('select = "1"');
|
|
95
|
-
expect(element.find("li").length).toBe(3);
|
|
96
|
-
expect(element.find("li").eq(0).text()).toBe("A");
|
|
97
|
-
expect(element.find("li").eq(1).text()).toBe("B");
|
|
98
|
-
expect(element.find("li").eq(2).text()).toBe("C");
|
|
99
|
-
|
|
100
|
-
$scope.$apply('select = "2"');
|
|
101
|
-
expect(element.find("li").length).toBe(3);
|
|
102
|
-
expect(element.find("li").eq(0).text()).toBe("D");
|
|
103
|
-
expect(element.find("li").eq(1).text()).toBe("E");
|
|
104
|
-
expect(element.find("li").eq(2).text()).toBe("F");
|
|
105
|
-
});
|
|
106
|
-
|
|
107
82
|
it("should switch on switch-when-default", () => {
|
|
108
83
|
element = $compile(
|
|
109
84
|
'<ng-switch on="select">' +
|
|
@@ -118,31 +93,6 @@ describe("ngSwitch", () => {
|
|
|
118
93
|
expect(element.text()).toEqual("one");
|
|
119
94
|
});
|
|
120
95
|
|
|
121
|
-
it("should show all default elements between start and end markers when no match", () => {
|
|
122
|
-
element = $compile(
|
|
123
|
-
'<ul ng-switch="select">' +
|
|
124
|
-
'<li ng-switch-when-start="1">A</li>' +
|
|
125
|
-
"<li>B</li>" +
|
|
126
|
-
"<li ng-switch-when-end>C</li>" +
|
|
127
|
-
"<li ng-switch-default-start>D</li>" +
|
|
128
|
-
"<li>E</li>" +
|
|
129
|
-
"<li ng-switch-default-end>F</li>" +
|
|
130
|
-
"</ul>",
|
|
131
|
-
)($scope);
|
|
132
|
-
|
|
133
|
-
$scope.$apply('select = "1"');
|
|
134
|
-
expect(element.find("li").length).toBe(3);
|
|
135
|
-
expect(element.find("li").eq(0).text()).toBe("A");
|
|
136
|
-
expect(element.find("li").eq(1).text()).toBe("B");
|
|
137
|
-
expect(element.find("li").eq(2).text()).toBe("C");
|
|
138
|
-
|
|
139
|
-
$scope.$apply('select = "2"');
|
|
140
|
-
expect(element.find("li").length).toBe(3);
|
|
141
|
-
expect(element.find("li").eq(0).text()).toBe("D");
|
|
142
|
-
expect(element.find("li").eq(1).text()).toBe("E");
|
|
143
|
-
expect(element.find("li").eq(2).text()).toBe("F");
|
|
144
|
-
});
|
|
145
|
-
|
|
146
96
|
it("should show all switch-when-default", () => {
|
|
147
97
|
element = $compile(
|
|
148
98
|
'<ul ng-switch="select">' +
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { minErr } from "../../shared/utils";
|
|
2
|
-
import { startingTag } from "../../shared/jqlite/jqlite";
|
|
1
|
+
import { minErr } from "../../shared/utils.js";
|
|
2
|
+
import { startingTag } from "../../shared/jqlite/jqlite.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
toInt,
|
|
5
5
|
minErr,
|
|
6
6
|
isUndefined,
|
|
7
|
-
} from "../../shared/utils";
|
|
7
|
+
} from "../../shared/utils.js";
|
|
8
8
|
import { REGEX_STRING_REGEXP } from "./../attrs/attrs";
|
|
9
|
-
import { startingTag } from "../../shared/jqlite/jqlite";
|
|
9
|
+
import { startingTag } from "../../shared/jqlite/jqlite.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
*
|
package/src/filters/filter.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Angular } from "../loader";
|
|
2
2
|
import { createInjector } from "../core/di/injector";
|
|
3
|
-
import { isString, includes } from "../shared/utils";
|
|
4
|
-
import { JQLite } from "../shared/jqlite/jqlite";
|
|
3
|
+
import { isString, includes } from "../shared/utils.js";
|
|
4
|
+
import { JQLite } from "../shared/jqlite/jqlite.js";
|
|
5
5
|
|
|
6
6
|
describe("Filter: filter", () => {
|
|
7
7
|
let filter;
|
package/src/filters/filters.js
CHANGED
package/src/filters/limit-to.js
CHANGED
package/src/filters/order-by.js
CHANGED
package/src/index.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { Angular } from "./loader";
|
|
2
2
|
|
|
3
3
|
export const angular = new Angular();
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
angular.init(document);
|
|
8
|
-
} else {
|
|
9
|
-
document.addEventListener("DOMContentLoaded", () => {
|
|
10
|
-
angular.init(document);
|
|
11
|
-
});
|
|
12
|
-
}
|
|
4
|
+
document.addEventListener("DOMContentLoaded", () => angular.init(document), {
|
|
5
|
+
once: true,
|
|
6
|
+
});
|
package/src/loader.js
CHANGED
|
@@ -4,15 +4,16 @@ import {
|
|
|
4
4
|
ngAttrPrefixes,
|
|
5
5
|
assertNotHasOwnProperty,
|
|
6
6
|
errorHandlingConfig,
|
|
7
|
-
} from "./shared/utils";
|
|
8
|
-
import { JQLite } from "./shared/jqlite/jqlite";
|
|
7
|
+
} from "./shared/utils.js";
|
|
8
|
+
import { JQLite } from "./shared/jqlite/jqlite.js";
|
|
9
9
|
import { annotate, createInjector } from "./core/di/injector";
|
|
10
10
|
import { NgModule } from "./core/di/ng-module";
|
|
11
|
-
import {
|
|
11
|
+
import { Cache } from "./core/cache/cache.js";
|
|
12
12
|
import { publishExternalAPI } from "./public";
|
|
13
13
|
import { VERSION } from "./public";
|
|
14
14
|
import { services } from "./router/common/coreservices";
|
|
15
15
|
import { unnestR } from "./shared/common";
|
|
16
|
+
import { EventBus } from "./core/pubsub/pubsub.js";
|
|
16
17
|
|
|
17
18
|
const ngMinErr = minErr("ng");
|
|
18
19
|
const $injectorMinErr = minErr("$injector");
|
|
@@ -29,10 +30,13 @@ const modules = {};
|
|
|
29
30
|
|
|
30
31
|
export class Angular {
|
|
31
32
|
constructor() {
|
|
32
|
-
|
|
33
|
+
Cache.clear(); // a ensure new instance of angular gets a clean Cache
|
|
33
34
|
|
|
34
35
|
/** @type {Map<number, import("./core/cache/cache").ExpandoStore>} */
|
|
35
|
-
this.cache =
|
|
36
|
+
this.cache = Cache;
|
|
37
|
+
|
|
38
|
+
/** @type {import('./core/pubsub/pubsub.js').PubSub} */
|
|
39
|
+
this.eventBus = EventBus;
|
|
36
40
|
|
|
37
41
|
/** @type {string} */
|
|
38
42
|
this.version = VERSION;
|
|
@@ -45,6 +49,7 @@ export class Angular {
|
|
|
45
49
|
|
|
46
50
|
/** @type {Function} */
|
|
47
51
|
this.doBootstrap;
|
|
52
|
+
window["angular"] = this;
|
|
48
53
|
publishExternalAPI(this);
|
|
49
54
|
}
|
|
50
55
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { filter, tail, unnestR } from "../../shared/common";
|
|
2
|
-
import { isDefined, isFunction, isString } from "../../shared/utils";
|
|
2
|
+
import { isDefined, isFunction, isString } from "../../shared/utils.js";
|
|
3
3
|
import { kebobString } from "../../shared/strings";
|
|
4
4
|
import { parse } from "../../shared/hof";
|
|
5
5
|
import { ResolveContext } from "../resolve/resolve-context";
|
|
6
6
|
import { trace } from "../common/trace";
|
|
7
7
|
import { Ng1ViewConfig } from "../state/views";
|
|
8
|
-
import { JQLite } from "../../shared/jqlite/jqlite";
|
|
8
|
+
import { JQLite } from "../../shared/jqlite/jqlite.js";
|
|
9
9
|
import { getLocals } from "../state/state-registry";
|
|
10
10
|
/**
|
|
11
11
|
* `ui-view`: A viewport directive which is filled in by a view from the active state.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { equals, inherit, map, pick } from "../../shared/common";
|
|
2
2
|
import { isNullOrUndefined } from "../../shared/predicates";
|
|
3
|
-
import { isDefined } from "../../shared/utils";
|
|
3
|
+
import { isDefined } from "../../shared/utils.js";
|
|
4
4
|
import { is } from "../../shared/hof";
|
|
5
5
|
import { services } from "../common/coreservices";
|
|
6
6
|
import { ParamType } from "./param-type";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { filter, map, allTrueR, find } from "../../shared/common";
|
|
2
2
|
import { isInjectable } from "../../shared/predicates";
|
|
3
|
-
import { isDefined, isUndefined, isString } from "../../shared/utils";
|
|
3
|
+
import { isDefined, isUndefined, isString } from "../../shared/utils.js";
|
|
4
4
|
import { services } from "../common/coreservices";
|
|
5
5
|
import { ParamType } from "./param-type";
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assert, isFunction, isObject } from "../../shared/utils";
|
|
1
|
+
import { assert, isFunction, isObject } from "../../shared/utils.js";
|
|
2
2
|
import { services } from "../common/coreservices";
|
|
3
3
|
import { trace } from "../common/trace";
|
|
4
4
|
import { stringify } from "../../shared/strings";
|
|
@@ -5,7 +5,7 @@ import { services } from "../common/coreservices";
|
|
|
5
5
|
import { Resolvable } from "./resolvable";
|
|
6
6
|
import { PathUtils } from "../path/path-utils";
|
|
7
7
|
import { stringify } from "../../shared/strings";
|
|
8
|
-
import { isUndefined } from "../../shared/utils";
|
|
8
|
+
import { isUndefined } from "../../shared/utils.js";
|
|
9
9
|
|
|
10
10
|
export const resolvePolicies = {
|
|
11
11
|
when: {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
copy,
|
|
7
7
|
map,
|
|
8
8
|
} from "../../shared/common";
|
|
9
|
-
import { isDefined, isFunction, isString } from "../../shared/utils";
|
|
9
|
+
import { isDefined, isFunction, isString } from "../../shared/utils.js";
|
|
10
10
|
import { stringify } from "../../shared/strings";
|
|
11
11
|
import { is, pattern, pipe, val } from "../../shared/hof";
|
|
12
12
|
import { Resolvable } from "../resolve/resolvable";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defaults, find } from "../../shared/common";
|
|
2
2
|
import { propEq } from "../../shared/hof";
|
|
3
3
|
import { Glob } from "../common/glob";
|
|
4
|
-
import { isFunction, isObject } from "../../shared/utils";
|
|
4
|
+
import { isFunction, isObject } from "../../shared/utils.js";
|
|
5
5
|
/**
|
|
6
6
|
* Internal representation of a ng-router state.
|
|
7
7
|
*
|
|
@@ -5,7 +5,7 @@ import { applyPairs, removeFrom } from "../../shared/common";
|
|
|
5
5
|
import { propEq } from "../../shared/hof";
|
|
6
6
|
import { ResolveContext } from "../resolve/resolve-context";
|
|
7
7
|
import { ng1ViewsBuilder } from "./views";
|
|
8
|
-
import { isString } from "../../shared/utils";
|
|
8
|
+
import { isString } from "../../shared/utils.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* A registry for all of the application's [[StateDeclaration]]s
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
silenceUncaughtInPromise,
|
|
6
6
|
silentRejection,
|
|
7
7
|
} from "../../shared/common";
|
|
8
|
-
import { isDefined, isObject, isString, minErr } from "../../shared/utils";
|
|
8
|
+
import { isDefined, isObject, isString, minErr } from "../../shared/utils.js";
|
|
9
9
|
import { Queue } from "../common/queue";
|
|
10
10
|
import { services } from "../common/coreservices";
|
|
11
11
|
import { makeTargetState } from "../path/path-utils";
|