@angular-wave/angular.ts 0.0.61 → 0.0.63
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 +2 -1
- package/src/angular.spec.js +2 -11
- package/src/animations/animate-css-driver.js +1 -1
- package/src/animations/animate-queue.js +9 -0
- package/src/core/compile/compile.js +0 -33
- package/src/core/compile/compile.spec.js +0 -47
- package/src/core/location/location.js +7 -0
- package/src/core/parser/parse.spec.js +7 -5
- package/src/directive/init/init.spec.js +2 -2
- package/src/filters/order-by.js +1 -2
- package/src/index.js +1 -1
- package/src/injector.js +7 -0
- package/src/loader.js +99 -710
- package/src/router/state-provider.js +1 -1
- package/src/router/url/url-service.spec.js +4 -3
- package/src/shared/jqlite/jqlite.js +20 -29
- package/src/shared/jqlite/jqlite.md +62 -0
- package/src/shared/min-err.spec.js +1 -2
- package/src/shared/utils.js +37 -12
- package/src/types.js +3 -4
- package/types/animations/animate-css-driver.d.ts +2 -1
- package/types/animations/animate-queue.d.ts +2 -1
- package/types/core/compile/compile.d.ts +0 -1
- package/types/core/location/location.d.ts +2 -1
- package/types/index.d.ts +5 -1
- package/types/injector.d.ts +7 -7
- package/types/loader.d.ts +64 -184
- package/types/router/state-provider.d.ts +1 -1
- package/types/shared/jqlite/jqlite.d.ts +5 -5
- package/types/shared/utils.d.ts +21 -8
- package/types/types.d.ts +3 -3
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-wave/angular.ts",
|
|
3
|
+
"description": "A modern, optimized and typesafe version of AngularJS",
|
|
3
4
|
"license": "MIT",
|
|
4
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.63",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"main": "dist/angular-ts.esm.js",
|
|
7
8
|
"browser": "dist/angular-ts.umd.js",
|
package/src/angular.spec.js
CHANGED
|
@@ -1923,15 +1923,6 @@ describe("angular", () => {
|
|
|
1923
1923
|
expect(injector).toBeDefined();
|
|
1924
1924
|
});
|
|
1925
1925
|
|
|
1926
|
-
it("should resume deferred bootstrap, if defined", () => {
|
|
1927
|
-
window.name = "NG_DEFER_BOOTSTRAP!";
|
|
1928
|
-
|
|
1929
|
-
angular.resumeDeferredBootstrap = () => {};
|
|
1930
|
-
const spy = spyOn(angular, "resumeDeferredBootstrap");
|
|
1931
|
-
injector = angular.bootstrap(element);
|
|
1932
|
-
expect(spy).toHaveBeenCalled();
|
|
1933
|
-
});
|
|
1934
|
-
|
|
1935
1926
|
it("should wait for extra modules", () => {
|
|
1936
1927
|
window.name = "NG_DEFER_BOOTSTRAP!";
|
|
1937
1928
|
angular.bootstrap(element);
|
|
@@ -2084,8 +2075,8 @@ describe("angular", () => {
|
|
|
2084
2075
|
body,
|
|
2085
2076
|
element,
|
|
2086
2077
|
];
|
|
2087
|
-
|
|
2088
|
-
const result =
|
|
2078
|
+
forEach(tests, (value, idx) => {
|
|
2079
|
+
const result = isElement(value);
|
|
2089
2080
|
expect(typeof result).toEqual("boolean");
|
|
2090
2081
|
expect(result).toEqual(expected[idx]);
|
|
2091
2082
|
});
|
|
@@ -27,7 +27,7 @@ export function $$AnimateCssDriverProvider($$animationProvider) {
|
|
|
27
27
|
*
|
|
28
28
|
* @param {*} $animateCss
|
|
29
29
|
* @param {typeof import('../core/animate/animate-runner').AnimateRunner} $$AnimateRunner
|
|
30
|
-
* @param {
|
|
30
|
+
* @param {JQLite} $rootElement
|
|
31
31
|
* @returns
|
|
32
32
|
*/
|
|
33
33
|
function ($animateCss, $$AnimateRunner, $rootElement) {
|
|
@@ -149,6 +149,15 @@ export function $$AnimateQueueProvider($animateProvider) {
|
|
|
149
149
|
"$$animation",
|
|
150
150
|
"$$AnimateRunner",
|
|
151
151
|
"$templateRequest",
|
|
152
|
+
/**
|
|
153
|
+
*
|
|
154
|
+
* @param {*} $rootScope
|
|
155
|
+
* @param {JQLite} $rootElement
|
|
156
|
+
* @param {*} $$animation
|
|
157
|
+
* @param {*} $$AnimateRunner
|
|
158
|
+
* @param {*} $templateRequest
|
|
159
|
+
* @returns
|
|
160
|
+
*/
|
|
152
161
|
function (
|
|
153
162
|
$rootScope,
|
|
154
163
|
$rootElement,
|
|
@@ -481,39 +481,6 @@ export function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
|
481
481
|
return $$sanitizeUriProvider.imgSrcSanitizationTrustedUrlList();
|
|
482
482
|
};
|
|
483
483
|
|
|
484
|
-
/**
|
|
485
|
-
* @ngdoc method
|
|
486
|
-
* @name $compileProvider#debugInfoEnabled
|
|
487
|
-
*
|
|
488
|
-
* @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the
|
|
489
|
-
* current debugInfoEnabled state
|
|
490
|
-
* @returns {*} current value if used as getter or itself (chaining) if used as setter
|
|
491
|
-
*
|
|
492
|
-
* @kind function
|
|
493
|
-
*
|
|
494
|
-
* @description
|
|
495
|
-
* Call this method to enable/disable various debug runtime information in the compiler such as adding
|
|
496
|
-
* binding information and a reference to the current scope on to DOM elements.
|
|
497
|
-
* If enabled, the compiler will add the following to DOM elements that have been bound to the scope
|
|
498
|
-
* * Data properties used by the {@link angular.element#methods `scope()`/`isolateScope()` methods} to return
|
|
499
|
-
* the element's scope.
|
|
500
|
-
* * Placeholder comments will contain information about what directive and binding caused the placeholder.
|
|
501
|
-
* E.g. `<!-- ngIf: shouldShow() -->`.
|
|
502
|
-
*
|
|
503
|
-
* You may want to disable this in production for a significant performance boost. See
|
|
504
|
-
* {@link guide/production#disabling-debug-data Disabling Debug Data} for more.
|
|
505
|
-
*
|
|
506
|
-
* The default value is true.
|
|
507
|
-
*/
|
|
508
|
-
let debugInfoEnabled = true;
|
|
509
|
-
this.debugInfoEnabled = function (enabled) {
|
|
510
|
-
if (isDefined(enabled)) {
|
|
511
|
-
debugInfoEnabled = enabled;
|
|
512
|
-
return this;
|
|
513
|
-
}
|
|
514
|
-
return debugInfoEnabled;
|
|
515
|
-
};
|
|
516
|
-
|
|
517
484
|
/**
|
|
518
485
|
* @ngdoc method
|
|
519
486
|
* @name $compileProvider#strictComponentBindingsEnabled
|
|
@@ -4585,17 +4585,6 @@ describe("$compile", () => {
|
|
|
4585
4585
|
]);
|
|
4586
4586
|
});
|
|
4587
4587
|
|
|
4588
|
-
it("should allow debugInfoEnabled to be configured", () => {
|
|
4589
|
-
createInjector([
|
|
4590
|
-
"ng",
|
|
4591
|
-
($compileProvider) => {
|
|
4592
|
-
expect($compileProvider.debugInfoEnabled()).toBe(true); // the default
|
|
4593
|
-
$compileProvider.debugInfoEnabled(false);
|
|
4594
|
-
expect($compileProvider.debugInfoEnabled()).toBe(false);
|
|
4595
|
-
},
|
|
4596
|
-
]);
|
|
4597
|
-
});
|
|
4598
|
-
|
|
4599
4588
|
it("should allow strictComponentBindingsEnabled to be configured", () => {
|
|
4600
4589
|
createInjector([
|
|
4601
4590
|
"ng",
|
|
@@ -7645,42 +7634,6 @@ describe("$compile", () => {
|
|
|
7645
7634
|
});
|
|
7646
7635
|
});
|
|
7647
7636
|
|
|
7648
|
-
describe("decorating with binding info", () => {
|
|
7649
|
-
it("should not occur if `debugInfoEnabled` is false", () => {
|
|
7650
|
-
createInjector([
|
|
7651
|
-
"test1",
|
|
7652
|
-
($compileProvider) => {
|
|
7653
|
-
$compileProvider.debugInfoEnabled(false);
|
|
7654
|
-
},
|
|
7655
|
-
]).invoke((_$compile_, _$rootScope_, _$templateCache_) => {
|
|
7656
|
-
$compile = _$compile_;
|
|
7657
|
-
$rootScope = _$rootScope_;
|
|
7658
|
-
$templateCache = _$templateCache_;
|
|
7659
|
-
});
|
|
7660
|
-
element = $compile("<div>{{1+2}}</div>")($rootScope);
|
|
7661
|
-
expect(element[0].classList.contains("ng-binding")).toBe(false);
|
|
7662
|
-
expect(element.data("$binding")).toBeUndefined();
|
|
7663
|
-
});
|
|
7664
|
-
|
|
7665
|
-
// TODO figure out debug strat
|
|
7666
|
-
// it("should occur if `debugInfoEnabled` is true", () => {
|
|
7667
|
-
// createInjector([
|
|
7668
|
-
// "test1",
|
|
7669
|
-
// ($compileProvider) => {
|
|
7670
|
-
// $compileProvider.debugInfoEnabled(true);
|
|
7671
|
-
// },
|
|
7672
|
-
// ]).invoke((_$compile_, _$rootScope_, _$templateCache_) => {
|
|
7673
|
-
// $compile = _$compile_;
|
|
7674
|
-
// $rootScope = _$rootScope_;
|
|
7675
|
-
// $templateCache = _$templateCache_;
|
|
7676
|
-
// });
|
|
7677
|
-
|
|
7678
|
-
// element = $compile("<div>{{1+2}}</div>")($rootScope);
|
|
7679
|
-
// expect(element[0].classList.contains("ng-binding")).toBe(true);
|
|
7680
|
-
// expect(element.data("$binding")).toEqual(["1+2"]);
|
|
7681
|
-
// });
|
|
7682
|
-
});
|
|
7683
|
-
|
|
7684
7637
|
it("should observe interpolated attrs", () => {
|
|
7685
7638
|
$compile('<div some-attr="{{value}}" observer></div>')($rootScope);
|
|
7686
7639
|
|
|
@@ -859,6 +859,13 @@ export function $LocationProvider() {
|
|
|
859
859
|
"$rootScope",
|
|
860
860
|
"$browser",
|
|
861
861
|
"$rootElement",
|
|
862
|
+
/**
|
|
863
|
+
*
|
|
864
|
+
* @param {*} $rootScope
|
|
865
|
+
* @param {*} $browser
|
|
866
|
+
* @param {JQLite} $rootElement
|
|
867
|
+
* @returns
|
|
868
|
+
*/
|
|
862
869
|
function ($rootScope, $browser, $rootElement) {
|
|
863
870
|
let $location;
|
|
864
871
|
let LocationMode;
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
csp,
|
|
8
8
|
valueFn,
|
|
9
9
|
extend,
|
|
10
|
-
identity,
|
|
11
10
|
} from "../../shared/utils";
|
|
12
11
|
import { publishExternalAPI } from "../../public";
|
|
13
12
|
import { createInjector } from "../../injector";
|
|
@@ -3673,7 +3672,10 @@ describe("parser", () => {
|
|
|
3673
3672
|
});
|
|
3674
3673
|
|
|
3675
3674
|
it("should always be invoked if flagged as $stateful when wrapping one-time with inputs", () => {
|
|
3676
|
-
filterProvider.register(
|
|
3675
|
+
filterProvider.register(
|
|
3676
|
+
"identity",
|
|
3677
|
+
valueFn((x) => x),
|
|
3678
|
+
);
|
|
3677
3679
|
|
|
3678
3680
|
let interceptorCalls = 0;
|
|
3679
3681
|
function interceptor() {
|
|
@@ -3799,7 +3801,7 @@ describe("parser", () => {
|
|
|
3799
3801
|
|
|
3800
3802
|
it("should not affect when a one-time binding becomes stable", () => {
|
|
3801
3803
|
scope.$watch($parse("::x"));
|
|
3802
|
-
scope.$watch($parse("::x",
|
|
3804
|
+
scope.$watch($parse("::x", (x) => x));
|
|
3803
3805
|
scope.$watch($parse("::x", () => 1)); // interceptor that returns non-undefined
|
|
3804
3806
|
|
|
3805
3807
|
scope.$digest();
|
|
@@ -3812,7 +3814,7 @@ describe("parser", () => {
|
|
|
3812
3814
|
|
|
3813
3815
|
it("should not affect when a one-time literal binding becomes stable", () => {
|
|
3814
3816
|
scope.$watch($parse("::[x]"));
|
|
3815
|
-
scope.$watch($parse("::[x]",
|
|
3817
|
+
scope.$watch($parse("::[x]", (x) => x));
|
|
3816
3818
|
scope.$watch($parse("::[x]", () => 1)); // interceptor that returns non-literal
|
|
3817
3819
|
|
|
3818
3820
|
scope.$digest();
|
|
@@ -3846,7 +3848,7 @@ describe("parser", () => {
|
|
|
3846
3848
|
scope.$watch(
|
|
3847
3849
|
$parse(
|
|
3848
3850
|
$parse("::{x:x, y:y}", (lit) => lit.x),
|
|
3849
|
-
|
|
3851
|
+
(x) => x,
|
|
3850
3852
|
),
|
|
3851
3853
|
(val) => logs.push(val),
|
|
3852
3854
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dealoc, JQLite } from "../../shared/jqlite/jqlite";
|
|
2
2
|
import { publishExternalAPI } from "../../public";
|
|
3
3
|
import { createInjector } from "../../injector";
|
|
4
|
-
import { Angular } from "../../loader";
|
|
4
|
+
import { Angular, setupModuleLoader } from "../../loader";
|
|
5
5
|
|
|
6
6
|
describe("ngInit", () => {
|
|
7
7
|
let element;
|
|
@@ -49,7 +49,7 @@ describe("ngInit", () => {
|
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
it("should be evaluated after ngController", () => {
|
|
52
|
-
angular.module("test1", ["ng"]);
|
|
52
|
+
window.angular.module("test1", ["ng"]);
|
|
53
53
|
createInjector([
|
|
54
54
|
"ng",
|
|
55
55
|
($controllerProvider) => {
|
package/src/filters/order-by.js
CHANGED
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
isArrayLike,
|
|
6
6
|
isString,
|
|
7
7
|
minErr,
|
|
8
|
-
identity,
|
|
9
8
|
} from "../shared/utils";
|
|
10
9
|
|
|
11
10
|
orderByFilter.$inject = ["$parse"];
|
|
@@ -75,7 +74,7 @@ export function orderByFilter($parse) {
|
|
|
75
74
|
function processPredicates(sortPredicates) {
|
|
76
75
|
return sortPredicates.map((predicate) => {
|
|
77
76
|
let descending = 1;
|
|
78
|
-
let get =
|
|
77
|
+
let get = (x) => x;
|
|
79
78
|
|
|
80
79
|
if (isFunction(predicate)) {
|
|
81
80
|
get = predicate;
|
package/src/index.js
CHANGED
package/src/injector.js
CHANGED
|
@@ -79,6 +79,13 @@ function annotate(fn, strictDi, name) {
|
|
|
79
79
|
|
|
80
80
|
const providerSuffix = "Provider";
|
|
81
81
|
const INSTANTIATING = {};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* @param {*} modulesToLoad
|
|
86
|
+
* @param {*} strictDi
|
|
87
|
+
* @returns {import("./types").InjectorService}
|
|
88
|
+
*/
|
|
82
89
|
export function createInjector(modulesToLoad, strictDi) {
|
|
83
90
|
if (isDefined(strictDi) && !isBoolean(strictDi)) {
|
|
84
91
|
throw $injectorMinErr("strictDi must be boolean");
|