@angular-wave/angular.ts 0.0.38 → 0.0.40
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 +8 -5
- package/README.md +1 -1
- package/dist/angular-ts.esm.js +2 -1
- package/dist/angular-ts.umd.js +2 -1
- package/package.json +2 -4
- package/rollup.config.js +11 -2
- package/src/angular.spec.js +25 -26
- package/src/animations/animate-css-driver.js +3 -3
- package/src/animations/animate-queue.js +7 -7
- package/src/animations/animation.js +2 -2
- package/src/animations/shared.js +6 -6
- package/src/binding.spec.js +7 -7
- package/src/core/animate/animate.js +5 -5
- package/src/core/animate/animate.spec.js +31 -31
- package/src/core/cache/cache-factory.html +18 -0
- package/src/core/cache/{cache-factor.test.js → cache-factory.test.js} +1 -1
- package/src/core/compile/compile.js +31 -25
- package/src/core/compile/compile.md +2 -2
- package/src/core/cookie-reader.spec.js +2 -2
- package/src/core/core.html +22 -0
- package/src/core/core.test.js +12 -0
- package/src/core/document.spec.js +4 -4
- package/src/core/exception-handler.js +30 -23
- package/src/core/interpolate/interpolate.js +7 -0
- package/src/core/{cache/cache-factor.html → location/location.html} +1 -1
- package/src/core/location/location.js +2 -2
- package/src/core/location/location.spec.js +17 -17
- package/src/core/location/location.test.js +12 -0
- package/src/core/on.spec.js +3 -3
- package/src/core/parser/parse.html +18 -0
- package/src/core/parser/parse.spec.js +1 -1
- package/src/core/parser/parse.test.js +12 -0
- package/src/core/prop.spec.js +3 -4
- package/src/core/pubsub/pubsub.html +18 -0
- package/src/core/pubsub/pubsub.spec.js +1 -1
- package/src/core/pubsub/pubsub.test.js +12 -0
- package/src/core/q/q.html +18 -0
- package/src/core/q/q.js +33 -0
- package/src/core/q/q.test.js +0 -0
- package/src/core/root-element.spec.js +4 -4
- package/src/core/sanitize/sanitize-uri.spec.js +1 -1
- package/src/core/sanitize/sanitize-uri.test.js +12 -0
- package/src/core/sanitize/sanitize.html +21 -0
- package/src/core/sce/sce.html +18 -0
- package/src/core/sce/sce.spec.js +2 -1
- package/src/core/sce/sce.test.js +12 -0
- package/src/core/scope/scope.html +18 -0
- package/src/core/scope/scope.js +5 -8
- package/src/core/scope/scope.spec.js +1 -1
- package/src/core/scope/scope.test.js +12 -0
- package/src/core/task-tracker-factory.js +9 -11
- package/src/core/timeout/timeout.html +18 -0
- package/src/core/timeout/timeout.js +9 -0
- package/src/core/timeout/timeout.spec.js +2 -2
- package/src/core/timeout/timout.test.js +12 -0
- package/src/core/url-utils/url-utils.html +18 -0
- package/src/core/url-utils/url-utils.spec.js +4 -2
- package/src/core/url-utils/url-utils.test.js +12 -0
- package/src/directive/attrs/attrs.spec.js +1 -2
- package/src/directive/attrs/boolean.spec.js +1 -2
- package/src/directive/attrs/element-style.spec.js +6 -7
- package/src/directive/attrs/src.spec.js +1 -2
- package/src/directive/bind/bind.spec.js +1 -2
- package/src/directive/class/class.spec.js +15 -16
- package/src/directive/cloak/cloak.spec.js +3 -4
- package/src/directive/controller/controller.spec.js +4 -5
- package/src/directive/events/click.spec.js +1 -2
- package/src/directive/events/event.spec.js +1 -1
- package/src/directive/events/events.js +7 -0
- package/src/directive/form/form.spec.js +17 -17
- package/src/directive/if/if.spec.js +2 -2
- package/src/directive/include/include.js +2 -2
- package/src/directive/include/include.spec.js +32 -32
- package/src/directive/init/init.spec.js +2 -3
- package/src/directive/input/input.spec.js +3 -3
- package/src/directive/list/list.spec.js +1 -2
- package/src/directive/model/model.js +13 -0
- package/src/directive/model/model.spec.js +4 -5
- package/src/directive/model-options/model-options.spec.js +3 -3
- package/src/directive/non-bindable/non-bindable.spec.js +1 -2
- package/src/directive/options/options.js +5 -5
- package/src/directive/options/options.spec.js +13 -13
- package/src/directive/ref/href.spec.js +1 -2
- package/src/directive/repeat/repeat.spec.js +12 -12
- package/src/directive/script/script.spec.js +2 -3
- package/src/directive/select/select.js +6 -6
- package/src/directive/select/select.spec.js +5 -5
- package/src/directive/show-hide/show-hide.spec.js +12 -13
- package/src/directive/style/style.spec.js +3 -4
- package/src/directive/switch/switch.spec.js +2 -3
- package/src/directive/validators/validators.spec.js +1 -1
- package/src/exts/aria/aria.spec.js +1 -2
- package/src/exts/messages/messages.spec.js +5 -5
- package/src/filters/filter.spec.js +5 -5
- package/src/filters/filters.html +21 -0
- package/src/filters/filters.spec.js +3 -3
- package/src/filters/filters.test.js +12 -0
- package/src/filters/limit-to.md +1 -1
- package/src/filters/limit-to.spec.js +4 -4
- package/src/filters/order-by.spec.js +2 -2
- package/src/index.js +462 -1
- package/src/loader.js +62 -17
- package/src/public.js +6 -2
- package/src/router/directives/state-directives.spec.js +90 -90
- package/src/router/directives/view-directive.js +2 -2
- package/src/router/directives/view-directive.spec.js +9 -9
- package/src/router/state/state.spec.js +2 -4
- package/src/router/template-factory.spec.js +2 -2
- package/src/router/transition/hook-registry.js +2 -2
- package/src/router/view/view.spec.js +1 -1
- package/src/services/browser.js +56 -39
- package/src/services/document.js +16 -13
- package/src/services/log.js +39 -43
- package/src/services/template-request.js +9 -0
- package/src/shared/common.js +0 -3
- package/src/shared/jqlite/jqlite.js +83 -89
- package/src/shared/jqlite/jqlite.spec.js +218 -222
- package/src/shared/strings.js +2 -2
- package/src/shared/test-utils.js +2 -2
- package/src/shared/utils.js +8 -11
- package/src/src.test.js +10 -0
- package/tsconfig.json +1 -1
- package/tsconfig.types.json +11 -0
- package/types/animations/animate-cache.d.ts +7 -7
- package/types/animations/animate-children-directive.d.ts +3 -6
- package/types/animations/animate-swap.d.ts +7 -16
- package/types/animations/animation.d.ts +2 -11
- package/types/animations/raf-scheduler.d.ts +3 -3
- package/types/animations/shared.d.ts +9 -24
- package/types/core/{animate-css.d.ts → animate/animate-css.d.ts} +2 -8
- package/types/core/{cache.d.ts → cache/cache.d.ts} +5 -5
- package/types/core/compile/compile.d.ts +173 -0
- package/types/core/controller/controller.d.ts +32 -0
- package/types/core/exception-handler.d.ts +9 -42
- package/types/core/filter/filter.d.ts +9 -0
- package/types/core/{interpolate.d.ts → interpolate/interpolate.d.ts} +23 -39
- package/types/core/interval/interval-factory.d.ts +4 -0
- package/types/core/{interval.d.ts → interval/interval.d.ts} +1 -1
- package/types/core/location/location.d.ts +209 -0
- package/types/core/pubsub/pubsub.d.ts +156 -0
- package/types/core/q/q.d.ts +65 -0
- package/types/core/sanitize/sanitize-uri.d.ts +53 -0
- package/types/core/{sce.d.ts → sce/sce.d.ts} +80 -86
- package/types/core/scope/scope.d.ts +727 -0
- package/types/core/task-tracker-factory.d.ts +45 -38
- package/types/core/timeout/timeout.d.ts +29 -0
- package/types/core/{urlUtils.d.ts → url-utils/url-utils.d.ts} +2 -7
- package/types/directive/{bind.d.ts → bind/bind.d.ts} +4 -10
- package/types/directive/{class.d.ts → class/class.d.ts} +12 -21
- package/types/directive/controller/controller.d.ts +6 -0
- package/types/directive/events/events.d.ts +5 -0
- package/types/directive/form/form.d.ts +200 -0
- package/types/directive/if/if.d.ts +8 -0
- package/types/directive/include/include.d.ts +14 -0
- package/types/directive/{input.d.ts → input/input.d.ts} +20 -69
- package/types/directive/{model.d.ts → model/model.d.ts} +281 -280
- package/types/directive/options/options.d.ts +9 -0
- package/types/directive/ref/ref.d.ts +5 -0
- package/types/directive/repeat/repeat.d.ts +8 -0
- package/types/directive/{script.d.ts → script/script.d.ts} +5 -8
- package/types/directive/{show-hide.d.ts → show-hide/show-hide.d.ts} +10 -16
- package/types/directive/switch/switch.d.ts +17 -0
- package/types/directive/transclude/transclude.d.ts +4 -0
- package/types/directive/{validators.d.ts → validators/validators.d.ts} +20 -35
- package/types/filters/filters.d.ts +10 -16
- package/types/filters/order-by.d.ts +2 -4
- package/types/index.d.ts +702 -0
- package/types/injector.d.ts +12 -0
- package/types/public.d.ts +5 -0
- package/types/router/common/coreservices.d.ts +2 -2
- package/types/router/common/glob.d.ts +9 -9
- package/types/router/common/queue.d.ts +13 -13
- package/types/router/common/trace.d.ts +43 -43
- package/types/router/directives/view-directive.d.ts +13 -32
- package/types/router/globals.d.ts +20 -20
- package/types/router/hooks/lazy-load.d.ts +2 -11
- package/types/router/hooks/redirect-to.d.ts +1 -4
- package/types/router/hooks/url.d.ts +1 -5
- package/types/router/hooks/views.d.ts +1 -4
- package/types/router/params/param-factory.d.ts +5 -5
- package/types/router/params/param-type.d.ts +35 -35
- package/types/router/params/param-types.d.ts +11 -11
- package/types/router/params/param.d.ts +38 -38
- package/types/router/params/state-params.d.ts +10 -10
- package/types/router/path/path-node.d.ts +34 -34
- package/types/router/path/path-utils.d.ts +73 -77
- package/types/router/resolve/resolvable.d.ts +32 -32
- package/types/router/resolve/resolve-context.d.ts +84 -84
- package/types/router/services.d.ts +4 -9
- package/types/router/state/state-builder.d.ts +27 -27
- package/types/router/state/state-matcher.d.ts +5 -5
- package/types/router/state/state-object.d.ts +58 -58
- package/types/router/state/state-queue-manager.d.ts +10 -16
- package/types/router/state/state-registry.d.ts +100 -107
- package/types/router/state/state-service.d.ts +411 -411
- package/types/router/state/target-state.d.ts +64 -69
- package/types/router/state/views.d.ts +31 -37
- package/types/router/state-filters.d.ts +7 -7
- package/types/router/state-provider.d.ts +105 -105
- package/types/router/template-factory.d.ts +83 -112
- package/types/router/transition/hook-builder.d.ts +25 -25
- package/types/router/transition/hook-registry.d.ts +68 -83
- package/types/router/transition/interface.d.ts +7 -7
- package/types/router/transition/reject-factory.d.ts +34 -34
- package/types/router/transition/transition-event-type.d.ts +9 -18
- package/types/router/transition/transition-hook.d.ts +77 -82
- package/types/router/transition/transition-service.d.ts +82 -99
- package/types/router/transition/transition.d.ts +369 -377
- package/types/router/url/url-config.d.ts +84 -84
- package/types/router/url/url-matcher.d.ts +115 -119
- package/types/router/url/url-rule.d.ts +114 -124
- package/types/router/url/url-rules.d.ts +217 -217
- package/types/router/url/url-service.d.ts +264 -269
- package/types/router/view/view.d.ts +114 -117
- package/types/router/view-scroll.d.ts +2 -2
- package/types/services/anchor-scroll.d.ts +2 -8
- package/types/services/browser.d.ts +157 -135
- package/types/services/cache-factory.d.ts +25 -25
- package/types/services/cookie-reader.d.ts +2 -2
- package/types/services/document.d.ts +13 -9
- package/types/services/http/http.d.ts +145 -0
- package/types/services/{http-backend.d.ts → http-backend/http-backend.d.ts} +3 -35
- package/types/services/log.d.ts +55 -52
- package/types/services/template-request.d.ts +44 -53
- package/types/shared/common.d.ts +4 -20
- package/types/{constants.d.ts → shared/constants.d.ts} +6 -6
- package/types/shared/hof.d.ts +1 -1
- package/types/{jqLite.d.ts → shared/jqlite/jqlite.d.ts} +16 -17
- package/types/shared/test-utils.d.ts +11 -0
- package/types/shared/utils.d.ts +29 -46
- package/types-back/global.d.ts +3 -1
- package/types-back/index.d.ts +3 -296
- package/types/core/compile.d.ts +0 -206
- package/types/core/controller.d.ts +0 -42
- package/types/core/filter.d.ts +0 -9
- package/types/core/interval-factory.d.ts +0 -21
- package/types/core/location.d.ts +0 -234
- package/types/core/pubsub.d.ts +0 -164
- package/types/core/q.d.ts +0 -33
- package/types/core/root-scope.d.ts +0 -754
- package/types/core/sanitize-uri.d.ts +0 -57
- package/types/core/timeout.d.ts +0 -31
- package/types/directive/controller.d.ts +0 -6
- package/types/directive/events.d.ts +0 -12
- package/types/directive/form.d.ts +0 -230
- package/types/directive/if.d.ts +0 -17
- package/types/directive/include.d.ts +0 -33
- package/types/directive/options.d.ts +0 -16
- package/types/directive/ref.d.ts +0 -11
- package/types/directive/repeat.d.ts +0 -23
- package/types/directive/switch.d.ts +0 -23
- package/types/directive/transclude.d.ts +0 -15
- package/types/services/http.d.ts +0 -157
- /package/src/core/cache/{cache-factor.spec.js → cache-factory.spec.js} +0 -0
- /package/types/directive/{attrs.d.ts → attrs/attrs.d.ts} +0 -0
- /package/types/directive/{change.d.ts → change/change.d.ts} +0 -0
- /package/types/directive/{cloak.d.ts → cloak/cloak.d.ts} +0 -0
- /package/types/directive/{init.d.ts → init/init.d.ts} +0 -0
- /package/types/directive/{list.d.ts → list/list.d.ts} +0 -0
- /package/types/directive/{non-bindable.d.ts → non-bindable/non-bindable.d.ts} +0 -0
- /package/types/directive/{style.d.ts → style/style.d.ts} +0 -0
- /package/types/exts/{aria.d.ts → aria/aria.d.ts} +0 -0
- /package/types/exts/{messages.d.ts → messages/messages.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { publishExternalAPI } from "../../public";
|
|
2
2
|
import { createInjector } from "../../injector";
|
|
3
|
-
import { dealoc,
|
|
3
|
+
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
4
|
import { forEach, valueFn } from "../../shared/utils";
|
|
5
5
|
import { Angular } from "../../loader";
|
|
6
6
|
|
|
@@ -637,13 +637,13 @@ describe("ngRepeat", () => {
|
|
|
637
637
|
});
|
|
638
638
|
|
|
639
639
|
it("should error on wrong parsing of ngRepeat", () => {
|
|
640
|
-
element =
|
|
640
|
+
element = JQLite('<ul><li ng-repeat="i dont parse"></li></ul>');
|
|
641
641
|
$compile(element)(scope);
|
|
642
642
|
expect(logs.shift().message).toMatch(/i dont parse/);
|
|
643
643
|
});
|
|
644
644
|
|
|
645
645
|
it("should throw error when left-hand-side of ngRepeat can't be parsed", () => {
|
|
646
|
-
element =
|
|
646
|
+
element = JQLite('<ul><li ng-repeat="i dont parse in foo"></li></ul>');
|
|
647
647
|
$compile(element)(scope);
|
|
648
648
|
expect(logs.shift().message).toMatch(/i dont parse/);
|
|
649
649
|
});
|
|
@@ -926,7 +926,7 @@ describe("ngRepeat", () => {
|
|
|
926
926
|
replace: true,
|
|
927
927
|
template: '<div ng-repeat="i in items">{{i}}|</div>',
|
|
928
928
|
}));
|
|
929
|
-
element =
|
|
929
|
+
element = JQLite("<div><span rr>{{i}}|</span></div>");
|
|
930
930
|
$compile(element)(scope);
|
|
931
931
|
scope.$apply();
|
|
932
932
|
expect(element.text()).toBe("");
|
|
@@ -952,7 +952,7 @@ describe("ngRepeat", () => {
|
|
|
952
952
|
|
|
953
953
|
$templateCache.put("rr.html", '<div ng-repeat="i in items">{{i}}|</div>');
|
|
954
954
|
|
|
955
|
-
element =
|
|
955
|
+
element = JQLite("<div><span rr>{{i}}|</span></div>");
|
|
956
956
|
$compile(element)(scope);
|
|
957
957
|
scope.$apply();
|
|
958
958
|
expect(element.text()).toBe("");
|
|
@@ -973,7 +973,7 @@ describe("ngRepeat", () => {
|
|
|
973
973
|
replace: true,
|
|
974
974
|
template: '<span ng-repeat="i in items">{{log(i)}}</span>',
|
|
975
975
|
}));
|
|
976
|
-
element =
|
|
976
|
+
element = JQLite("<span replace-me-with-repeater></span>");
|
|
977
977
|
$compile(element)(scope);
|
|
978
978
|
expect(element.text()).toBe("");
|
|
979
979
|
const scopeLog = [];
|
|
@@ -998,7 +998,7 @@ describe("ngRepeat", () => {
|
|
|
998
998
|
"replace-me-with-repeater.html",
|
|
999
999
|
'<div ng-repeat="i in items">{{log(i)}}</div>',
|
|
1000
1000
|
);
|
|
1001
|
-
element =
|
|
1001
|
+
element = JQLite(
|
|
1002
1002
|
"<span>-</span><span replace-me-with-repeater></span><span>-</span>",
|
|
1003
1003
|
);
|
|
1004
1004
|
$compile(element)(scope);
|
|
@@ -1058,7 +1058,7 @@ describe("ngRepeat", () => {
|
|
|
1058
1058
|
$compileProvider.directive("test", () => ({
|
|
1059
1059
|
templateUrl: "/public/test.html",
|
|
1060
1060
|
}));
|
|
1061
|
-
element =
|
|
1061
|
+
element = JQLite('<div><div ng-repeat="i in items" test></div></div>');
|
|
1062
1062
|
$compile(element)(scope);
|
|
1063
1063
|
scope.items = [1];
|
|
1064
1064
|
scope.$apply();
|
|
@@ -1093,7 +1093,7 @@ describe("ngRepeat", () => {
|
|
|
1093
1093
|
expect(ends.length).toBe(3);
|
|
1094
1094
|
|
|
1095
1095
|
// insert an extra element inside the second block
|
|
1096
|
-
const extra =
|
|
1096
|
+
const extra = JQLite("<strong></strong>")[0];
|
|
1097
1097
|
element[0].insertBefore(extra, ends[1]);
|
|
1098
1098
|
|
|
1099
1099
|
scope.values.splice(1, 1);
|
|
@@ -1122,7 +1122,7 @@ describe("ngRepeat", () => {
|
|
|
1122
1122
|
expect(ends.length).toBe(3);
|
|
1123
1123
|
|
|
1124
1124
|
// insert an extra element inside the third block
|
|
1125
|
-
const extra =
|
|
1125
|
+
const extra = JQLite("<strong></strong>")[0];
|
|
1126
1126
|
element[0].insertBefore(extra, ends[2]);
|
|
1127
1127
|
|
|
1128
1128
|
// move the third block to the beginning
|
|
@@ -1289,7 +1289,7 @@ describe("ngRepeat", () => {
|
|
|
1289
1289
|
window.angular = new Angular();
|
|
1290
1290
|
publishExternalAPI();
|
|
1291
1291
|
|
|
1292
|
-
element =
|
|
1292
|
+
element = JQLite(
|
|
1293
1293
|
'<div><div ng-repeat="i in [1,2]" ng-include="\'/public/test.html\'"></div></div>',
|
|
1294
1294
|
);
|
|
1295
1295
|
const injector = window.angular.bootstrap(element);
|
|
@@ -1467,7 +1467,7 @@ describe("ngRepeat", () => {
|
|
|
1467
1467
|
// // we need to run animation on attached elements;
|
|
1468
1468
|
// function (_$rootElement_) {
|
|
1469
1469
|
// $rootElement = _$rootElement_;
|
|
1470
|
-
// body =
|
|
1470
|
+
// body = JQLite(window.document.body);
|
|
1471
1471
|
// body.append($rootElement);
|
|
1472
1472
|
// },
|
|
1473
1473
|
// ),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { publishExternalAPI } from "../../public";
|
|
2
2
|
import { createInjector } from "../../injector";
|
|
3
|
-
import { dealoc,
|
|
3
|
+
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
4
|
|
|
5
5
|
describe("scriptDirective", () => {
|
|
6
6
|
let $rootScope;
|
|
@@ -21,7 +21,6 @@ describe("scriptDirective", () => {
|
|
|
21
21
|
|
|
22
22
|
afterEach(() => {
|
|
23
23
|
dealoc(element);
|
|
24
|
-
jqLite.CACHE.clear();
|
|
25
24
|
});
|
|
26
25
|
|
|
27
26
|
it("should populate $templateCache with contents of a ng-template script element", () => {
|
|
@@ -36,7 +35,7 @@ describe("scriptDirective", () => {
|
|
|
36
35
|
});
|
|
37
36
|
|
|
38
37
|
it("should not compile scripts", () => {
|
|
39
|
-
const doc =
|
|
38
|
+
const doc = JQLite("<div></div>");
|
|
40
39
|
// jQuery is too smart and removes script tags
|
|
41
40
|
doc[0].innerHTML =
|
|
42
41
|
"foo" +
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JQLite } from "../../shared/jqlite/jqlite";
|
|
2
2
|
import {
|
|
3
3
|
assertNotHasOwnProperty,
|
|
4
4
|
equals,
|
|
@@ -50,9 +50,9 @@ var SelectController = [
|
|
|
50
50
|
// option is '? XXX ?' where XXX is the hashKey of the value that is not known.
|
|
51
51
|
//
|
|
52
52
|
// Support: IE 9 only
|
|
53
|
-
// We can't just
|
|
53
|
+
// We can't just JQLite('<option>') since JQLite is not smart enough
|
|
54
54
|
// to create it in <select> and IE barfs otherwise.
|
|
55
|
-
self.unknownOption =
|
|
55
|
+
self.unknownOption = JQLite(window.document.createElement("option"));
|
|
56
56
|
|
|
57
57
|
// The empty option is an option with the value '' that the application developer can
|
|
58
58
|
// provide inside the select. It is always selectable and indicates that a "null" selection has
|
|
@@ -128,7 +128,7 @@ var SelectController = [
|
|
|
128
128
|
const currentlySelectedOption =
|
|
129
129
|
$element[0].options[$element[0].selectedIndex];
|
|
130
130
|
if (currentlySelectedOption)
|
|
131
|
-
setOptionSelectedStatus(
|
|
131
|
+
setOptionSelectedStatus(JQLite(currentlySelectedOption), false);
|
|
132
132
|
|
|
133
133
|
if (self.hasOption(value)) {
|
|
134
134
|
self.removeUnknownOption();
|
|
@@ -138,7 +138,7 @@ var SelectController = [
|
|
|
138
138
|
|
|
139
139
|
// Set selected attribute and property on selected option for screen readers
|
|
140
140
|
const selectedOption = $element[0].options[$element[0].selectedIndex];
|
|
141
|
-
setOptionSelectedStatus(
|
|
141
|
+
setOptionSelectedStatus(JQLite(selectedOption), true);
|
|
142
142
|
} else {
|
|
143
143
|
self.selectUnknownOrEmptyOption(value);
|
|
144
144
|
}
|
|
@@ -526,7 +526,7 @@ export const selectDirective = function () {
|
|
|
526
526
|
// Note: this behavior cannot be replicated via unit tests because it only shows in the
|
|
527
527
|
// actual user interface.
|
|
528
528
|
if (shouldBeSelected !== currentlySelected) {
|
|
529
|
-
setOptionSelectedStatus(
|
|
529
|
+
setOptionSelectedStatus(JQLite(option), shouldBeSelected);
|
|
530
530
|
}
|
|
531
531
|
},
|
|
532
532
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { publishExternalAPI } from "../../public";
|
|
2
2
|
import { createInjector } from "../../injector";
|
|
3
|
-
import { dealoc,
|
|
3
|
+
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
4
|
import { forEach, hashKey, equals, isNumberNaN } from "../../shared/utils";
|
|
5
5
|
import { browserTrigger } from "../../shared/test-utils";
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ describe("select", () => {
|
|
|
16
16
|
const optionAttributesList = [];
|
|
17
17
|
|
|
18
18
|
function compile(html) {
|
|
19
|
-
formElement =
|
|
19
|
+
formElement = JQLite(`<form name="form">${html}</form>`);
|
|
20
20
|
element = formElement.find("select");
|
|
21
21
|
$compile(formElement)(scope);
|
|
22
22
|
ngModelCtrl = element.controller("ngModel");
|
|
@@ -357,7 +357,7 @@ describe("select", () => {
|
|
|
357
357
|
scope.mySelect = "B";
|
|
358
358
|
scope.$apply();
|
|
359
359
|
|
|
360
|
-
const select =
|
|
360
|
+
const select = JQLite(
|
|
361
361
|
'<select ng-model="mySelect">' +
|
|
362
362
|
'<optgroup label="first">' +
|
|
363
363
|
'<option value="A">A</option>' +
|
|
@@ -381,7 +381,7 @@ describe("select", () => {
|
|
|
381
381
|
scope.mySelect = "B";
|
|
382
382
|
scope.$apply();
|
|
383
383
|
|
|
384
|
-
const select =
|
|
384
|
+
const select = JQLite(
|
|
385
385
|
'<select spy-on-write-value ng-model="mySelect">' +
|
|
386
386
|
'<optgroup label="first">' +
|
|
387
387
|
'<option value="A">A</option>' +
|
|
@@ -1781,7 +1781,7 @@ describe("select", () => {
|
|
|
1781
1781
|
|
|
1782
1782
|
forEach(element.find("option"), (option) => {
|
|
1783
1783
|
// browserTrigger can't produce click + ctrl, so set selection manually
|
|
1784
|
-
|
|
1784
|
+
JQLite(option)[0].selected = true;
|
|
1785
1785
|
});
|
|
1786
1786
|
|
|
1787
1787
|
browserTrigger(element, "change");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { publishExternalAPI } from "../../public";
|
|
2
2
|
import { createInjector } from "../../injector";
|
|
3
|
-
import { dealoc,
|
|
3
|
+
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
4
|
|
|
5
5
|
describe("ngShow / ngHide", () => {
|
|
6
6
|
let $scope;
|
|
@@ -17,12 +17,11 @@ describe("ngShow / ngHide", () => {
|
|
|
17
17
|
|
|
18
18
|
afterEach(() => {
|
|
19
19
|
dealoc(element);
|
|
20
|
-
jqLite.CACHE.clear();
|
|
21
20
|
});
|
|
22
21
|
|
|
23
22
|
describe("ngShow", () => {
|
|
24
23
|
it("should show and hide an element", () => {
|
|
25
|
-
element =
|
|
24
|
+
element = JQLite('<div ng-show="exp"></div>');
|
|
26
25
|
element = $compile(element)($scope);
|
|
27
26
|
$scope.$digest();
|
|
28
27
|
expect(element[0].classList.contains("ng-hide")).toBeTrue();
|
|
@@ -33,7 +32,7 @@ describe("ngShow / ngHide", () => {
|
|
|
33
32
|
|
|
34
33
|
// https://github.com/angular/angular.js/issues/5414
|
|
35
34
|
it("should show if the expression is a function with a no arguments", () => {
|
|
36
|
-
element =
|
|
35
|
+
element = JQLite('<div ng-show="exp"></div>');
|
|
37
36
|
element = $compile(element)($scope);
|
|
38
37
|
$scope.exp = function () {};
|
|
39
38
|
$scope.$digest();
|
|
@@ -41,7 +40,7 @@ describe("ngShow / ngHide", () => {
|
|
|
41
40
|
});
|
|
42
41
|
|
|
43
42
|
it("should make hidden element visible", () => {
|
|
44
|
-
element =
|
|
43
|
+
element = JQLite('<div class="ng-hide" ng-show="exp"></div>');
|
|
45
44
|
element = $compile(element)($scope);
|
|
46
45
|
expect(element[0].classList.contains("ng-hide")).toBeTrue();
|
|
47
46
|
$scope.exp = true;
|
|
@@ -51,7 +50,7 @@ describe("ngShow / ngHide", () => {
|
|
|
51
50
|
|
|
52
51
|
it("should hide the element if condition is falsy", () => {
|
|
53
52
|
["false", "undefined", "null", "NaN", "''", "0"].forEach((x) => {
|
|
54
|
-
element =
|
|
53
|
+
element = JQLite(`<div ng-show="${x}"></div>`);
|
|
55
54
|
element = $compile(element)($scope);
|
|
56
55
|
$scope.$digest();
|
|
57
56
|
expect(element[0].classList.contains("ng-hide")).toBeTrue();
|
|
@@ -60,7 +59,7 @@ describe("ngShow / ngHide", () => {
|
|
|
60
59
|
|
|
61
60
|
it("should show the element if condition is a non-empty string", () => {
|
|
62
61
|
["'f'", "'0'", "'false'", "'no'", "'n'", "'[]'"].forEach((x) => {
|
|
63
|
-
element =
|
|
62
|
+
element = JQLite(`<div ng-show="${x}"></div>`);
|
|
64
63
|
element = $compile(element)($scope);
|
|
65
64
|
$scope.$digest();
|
|
66
65
|
expect(element[0].classList.contains("ng-hide")).toBeFalse();
|
|
@@ -69,7 +68,7 @@ describe("ngShow / ngHide", () => {
|
|
|
69
68
|
|
|
70
69
|
it("should show the element if condition is an object", () => {
|
|
71
70
|
["[]", "{}"].forEach((x) => {
|
|
72
|
-
element =
|
|
71
|
+
element = JQLite(`<div ng-show="${x}"></div>`);
|
|
73
72
|
element = $compile(element)($scope);
|
|
74
73
|
$scope.$digest();
|
|
75
74
|
expect(element[0].classList.contains("ng-hide")).toBeFalse();
|
|
@@ -79,7 +78,7 @@ describe("ngShow / ngHide", () => {
|
|
|
79
78
|
|
|
80
79
|
describe("ngHide", () => {
|
|
81
80
|
it("should hide an element", () => {
|
|
82
|
-
element =
|
|
81
|
+
element = JQLite('<div ng-hide="exp"></div>');
|
|
83
82
|
element = $compile(element)($scope);
|
|
84
83
|
expect(element[0].classList.contains("ng-hide")).toBeFalse();
|
|
85
84
|
$scope.exp = true;
|
|
@@ -89,7 +88,7 @@ describe("ngShow / ngHide", () => {
|
|
|
89
88
|
|
|
90
89
|
it("should show the element if condition is falsy", () => {
|
|
91
90
|
["false", "undefined", "null", "NaN", "''", "0"].forEach((x) => {
|
|
92
|
-
element =
|
|
91
|
+
element = JQLite(`<div ng-hide="${x}"></div>`);
|
|
93
92
|
element = $compile(element)($scope);
|
|
94
93
|
$scope.$digest();
|
|
95
94
|
expect(element[0].classList.contains("ng-hide")).toBeFalse();
|
|
@@ -98,7 +97,7 @@ describe("ngShow / ngHide", () => {
|
|
|
98
97
|
|
|
99
98
|
it("should hide the element if condition is a non-empty string", () => {
|
|
100
99
|
["'f'", "'0'", "'false'", "'no'", "'n'", "'[]'"].forEach((x) => {
|
|
101
|
-
element =
|
|
100
|
+
element = JQLite(`<div ng-hide="${x}"></div>`);
|
|
102
101
|
element = $compile(element)($scope);
|
|
103
102
|
$scope.$digest();
|
|
104
103
|
expect(element[0].classList.contains("ng-hide")).toBeTrue();
|
|
@@ -107,7 +106,7 @@ describe("ngShow / ngHide", () => {
|
|
|
107
106
|
|
|
108
107
|
it("should hide the element if condition is an object", () => {
|
|
109
108
|
["[]", "{}"].forEach((x) => {
|
|
110
|
-
element =
|
|
109
|
+
element = JQLite(`<div ng-hide="${x}"></div>`);
|
|
111
110
|
element = $compile(element)($scope);
|
|
112
111
|
$scope.$digest();
|
|
113
112
|
expect(element[0].classList.contains("ng-hide")).toBeTrue();
|
|
@@ -130,7 +129,7 @@ describe("ngShow / ngHide", () => {
|
|
|
130
129
|
|
|
131
130
|
// beforeEach(() => {
|
|
132
131
|
// // we need to run animation on attached elements;
|
|
133
|
-
// body =
|
|
132
|
+
// body = JQLite(window.document.body);
|
|
134
133
|
// });
|
|
135
134
|
|
|
136
135
|
// afterEach(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { publishExternalAPI } from "../../public";
|
|
2
2
|
import { createInjector } from "../../injector";
|
|
3
|
-
import { dealoc,
|
|
3
|
+
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
4
|
|
|
5
5
|
describe("ng-style", () => {
|
|
6
6
|
let $scope;
|
|
@@ -17,7 +17,6 @@ describe("ng-style", () => {
|
|
|
17
17
|
|
|
18
18
|
afterEach(() => {
|
|
19
19
|
dealoc(element);
|
|
20
|
-
jqLite.CACHE.clear();
|
|
21
20
|
});
|
|
22
21
|
|
|
23
22
|
it("should set", () => {
|
|
@@ -82,9 +81,9 @@ describe("ng-style", () => {
|
|
|
82
81
|
preCompVal = "300px";
|
|
83
82
|
postCompStyle = "height";
|
|
84
83
|
postCompVal = "100px";
|
|
85
|
-
element =
|
|
84
|
+
element = JQLite('<div ng-style="styleObj"></div>');
|
|
86
85
|
element[0].style[preCompStyle] = preCompVal;
|
|
87
|
-
|
|
86
|
+
JQLite(window.document.body).append(element);
|
|
88
87
|
$compile(element)($scope);
|
|
89
88
|
scope = $scope;
|
|
90
89
|
scope.styleObj = { "margin-top": "44px" };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { publishExternalAPI } from "../../public";
|
|
2
2
|
import { createInjector } from "../../injector";
|
|
3
|
-
import { dealoc,
|
|
3
|
+
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
4
|
|
|
5
5
|
describe("ngSwitch", () => {
|
|
6
6
|
let $scope;
|
|
@@ -19,7 +19,6 @@ describe("ngSwitch", () => {
|
|
|
19
19
|
|
|
20
20
|
afterEach(() => {
|
|
21
21
|
dealoc(element);
|
|
22
|
-
jqLite.CACHE.clear();
|
|
23
22
|
});
|
|
24
23
|
|
|
25
24
|
it("should switch on value change", () => {
|
|
@@ -497,7 +496,7 @@ describe("ngSwitch", () => {
|
|
|
497
496
|
// // we need to run animation on attached elements;
|
|
498
497
|
// function (_$rootElement_) {
|
|
499
498
|
// $rootElement = _$rootElement_;
|
|
500
|
-
// body =
|
|
499
|
+
// body = JQLite(window.document.body);
|
|
501
500
|
// body.append($rootElement);
|
|
502
501
|
// },
|
|
503
502
|
// ),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { publishExternalAPI } from "../../public";
|
|
2
2
|
import { createInjector } from "../../injector";
|
|
3
|
-
import { dealoc,
|
|
3
|
+
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
4
|
|
|
5
5
|
describe("validators", () => {
|
|
6
6
|
let $rootScope;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createInjector } from "../../injector";
|
|
2
2
|
import { publishExternalAPI } from "../../public";
|
|
3
|
-
import { dealoc,
|
|
3
|
+
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
4
4
|
|
|
5
5
|
describe("$aria", () => {
|
|
6
6
|
let scope;
|
|
@@ -17,7 +17,6 @@ describe("$aria", () => {
|
|
|
17
17
|
|
|
18
18
|
afterEach(() => {
|
|
19
19
|
dealoc(element);
|
|
20
|
-
jqLite.CACHE.clear();
|
|
21
20
|
});
|
|
22
21
|
|
|
23
22
|
describe("with `ngAriaDisable`", () => {
|
|
@@ -2,7 +2,7 @@ import { createInjector } from "../../injector";
|
|
|
2
2
|
import { countWatchers } from "../../core/scope/scope";
|
|
3
3
|
import { publishExternalAPI } from "../../public";
|
|
4
4
|
import { isString } from "../../shared/utils";
|
|
5
|
-
import {
|
|
5
|
+
import { JQLite } from "../../shared/jqlite/jqlite";
|
|
6
6
|
|
|
7
7
|
describe("ngMessages", () => {
|
|
8
8
|
let $rootScope, $compile, $templateCache;
|
|
@@ -481,7 +481,7 @@ describe("ngMessages", () => {
|
|
|
481
481
|
$rootScope.$digest();
|
|
482
482
|
|
|
483
483
|
// Simulate the animation completing on the node
|
|
484
|
-
//
|
|
484
|
+
// JQLite(nodeToRemove).remove();
|
|
485
485
|
|
|
486
486
|
// We should not get another call to `leave`
|
|
487
487
|
//expect($animate.leave).not.toHaveBeenCalled();
|
|
@@ -573,7 +573,7 @@ describe("ngMessages", () => {
|
|
|
573
573
|
const deregisterSpy = spyOn(ctrl, "deregister").and.callThrough();
|
|
574
574
|
|
|
575
575
|
const nodeA = element[0].querySelector('[ng-message="a"]');
|
|
576
|
-
|
|
576
|
+
JQLite(nodeA).remove();
|
|
577
577
|
$rootScope.$digest(); // The next digest triggers the error
|
|
578
578
|
|
|
579
579
|
// Make sure removing the element triggers the deregistration in ngMessages
|
|
@@ -612,7 +612,7 @@ describe("ngMessages", () => {
|
|
|
612
612
|
const deregisterSpy = spyOn(ctrl, "deregister").and.callThrough();
|
|
613
613
|
|
|
614
614
|
const nodeB = element[0].querySelector('[ng-message="b"]');
|
|
615
|
-
|
|
615
|
+
JQLite(nodeB).remove();
|
|
616
616
|
$rootScope.$digest(); // The next digest triggers the error
|
|
617
617
|
|
|
618
618
|
// Make sure removing the element triggers the deregistration in ngMessages
|
|
@@ -1016,7 +1016,7 @@ describe("ngMessages", () => {
|
|
|
1016
1016
|
// const deregisterSpy = spyOn(ctrl, "deregister").and.callThrough();
|
|
1017
1017
|
|
|
1018
1018
|
// const nodeB = element[0].querySelector('[ng-message="b"]');
|
|
1019
|
-
//
|
|
1019
|
+
// JQLite(nodeB).remove();
|
|
1020
1020
|
|
|
1021
1021
|
// // Make sure removing the element triggers the deregistration in ngMessages
|
|
1022
1022
|
// expect(trim(deregisterSpy.calls.mostRecent().args[0].nodeValue)).toBe(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { publishExternalAPI } from "
|
|
2
|
-
import { createInjector } from "
|
|
3
|
-
import { isString, includes } from "
|
|
4
|
-
import {
|
|
1
|
+
import { publishExternalAPI } from "../public";
|
|
2
|
+
import { createInjector } from "../injector";
|
|
3
|
+
import { isString, includes } from "../shared/utils";
|
|
4
|
+
import { JQLite } from "../shared/jqlite/jqlite";
|
|
5
5
|
|
|
6
6
|
describe("Filter: filter", () => {
|
|
7
7
|
let filter;
|
|
@@ -491,7 +491,7 @@ describe("Filter: filter", () => {
|
|
|
491
491
|
{ name: "Brad" },
|
|
492
492
|
);
|
|
493
493
|
|
|
494
|
-
const nodeList =
|
|
494
|
+
const nodeList = JQLite(
|
|
495
495
|
"<p><span>Misko</span><span>Igor</span><span>Brad</span></p>",
|
|
496
496
|
)[0].childNodes;
|
|
497
497
|
function nodeFilterPredicate(node) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>AngularTS Test Runner</title>
|
|
6
|
+
|
|
7
|
+
<link rel="shortcut icon" type="image/png" href="/images/favicon.ico" />
|
|
8
|
+
<link rel="stylesheet" href="/jasmine/jasmine-5.1.2/jasmine.css" />
|
|
9
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine.js"></script>
|
|
10
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine-html.js"></script>
|
|
11
|
+
<script src="/jasmine/jasmine-5.1.2/boot0.js"></script>
|
|
12
|
+
<script src="/jasmine/jasmine-5.1.2/boot1.js"></script>
|
|
13
|
+
<script type="module" src="/src/filters/filter.spec.js"></script>
|
|
14
|
+
<script type="module" src="/src/filters/filters.spec.js"></script>
|
|
15
|
+
<script type="module" src="/src/filters/limit-to.spec.js"></script>
|
|
16
|
+
<script type="module" src="/src/filters/order-by.spec.js"></script>
|
|
17
|
+
</head>
|
|
18
|
+
<body>
|
|
19
|
+
<div id="dummy"></div>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { publishExternalAPI } from "
|
|
2
|
-
import { createInjector } from "
|
|
3
|
-
import { toJson } from "
|
|
1
|
+
import { publishExternalAPI } from "../public";
|
|
2
|
+
import { createInjector } from "../injector";
|
|
3
|
+
import { toJson } from "../shared/utils";
|
|
4
4
|
|
|
5
5
|
describe("filters", () => {
|
|
6
6
|
let filter;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
const TEST_URL = "src/filters/filters.html";
|
|
4
|
+
|
|
5
|
+
test("unit tests contain no errors", async ({ page }) => {
|
|
6
|
+
await page.goto(TEST_URL);
|
|
7
|
+
await page.content();
|
|
8
|
+
await page.waitForTimeout(100);
|
|
9
|
+
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
+
/0 failures/,
|
|
11
|
+
);
|
|
12
|
+
});
|
package/src/filters/limit-to.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Description
|
|
4
4
|
|
|
5
|
-
Creates a new array or string containing only a specified number of elements. The elements are taken from either the beginning or the end of the source array, string, or number, as specified by the value and sign (positive or negative) of `limit`. Other array-like objects are also supported (e.g., array subclasses, NodeLists,
|
|
5
|
+
Creates a new array or string containing only a specified number of elements. The elements are taken from either the beginning or the end of the source array, string, or number, as specified by the value and sign (positive or negative) of `limit`. Other array-like objects are also supported (e.g., array subclasses, NodeLists, JQLite/jQuery collections, etc.). If a number is used as input, it is converted to a string.
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { publishExternalAPI } from "
|
|
2
|
-
import { createInjector } from "
|
|
3
|
-
import {
|
|
1
|
+
import { publishExternalAPI } from "../public";
|
|
2
|
+
import { createInjector } from "../injector";
|
|
3
|
+
import { JQLite } from "../shared/jqlite/jqlite";
|
|
4
4
|
|
|
5
5
|
describe("Filter: limitTo", () => {
|
|
6
6
|
let items;
|
|
@@ -240,7 +240,7 @@ describe("Filter: limitTo", () => {
|
|
|
240
240
|
{ name: "Brad" },
|
|
241
241
|
);
|
|
242
242
|
|
|
243
|
-
const nodeList =
|
|
243
|
+
const nodeList = JQLite(
|
|
244
244
|
"<p><span>Misko</span><span>Igor</span><span>Brad</span></p>",
|
|
245
245
|
)[0].childNodes;
|
|
246
246
|
|