@angular-wave/angular.ts 0.7.8 → 0.8.1
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/@types/{loader.d.ts → angular.d.ts} +3 -3
- package/@types/core/di/ng-module.d.ts +61 -25
- package/@types/core/parse/parse.d.ts +6 -7
- package/@types/directive/bind/bind.d.ts +2 -1
- package/@types/index.d.ts +1 -1
- package/@types/interface.d.ts +4 -2
- package/@types/{public.d.ts → ng.d.ts} +2 -2
- package/@types/router/directives/state-directives.d.ts +2 -2
- package/@types/router/directives/view-directive.d.ts +1 -1
- package/@types/router/params/param-type.d.ts +0 -1
- package/@types/router/path/path-utils.d.ts +8 -11
- package/@types/router/{globals.d.ts → router.d.ts} +2 -2
- package/@types/router/state/interface.d.ts +1 -1
- package/@types/router/state/state-object.d.ts +1 -1
- package/@types/router/state/state-registry.d.ts +2 -2
- package/@types/router/state/state-service.d.ts +14 -16
- package/@types/router/state-filters.d.ts +24 -2
- package/@types/router/transition/transition-service.d.ts +3 -3
- package/@types/router/transition/transition.d.ts +16 -19
- package/@types/router/url/url-matcher.d.ts +3 -4
- package/@types/router/url/url-rule.d.ts +14 -4
- package/@types/router/url/url-rules.d.ts +26 -6
- package/@types/router/url/url-service.d.ts +28 -38
- package/@types/services/http/http.d.ts +48 -1
- package/@types/services/http-backend/http-backend.d.ts +48 -35
- package/@types/services/location/interface.d.ts +55 -0
- package/@types/services/location/location.d.ts +225 -252
- package/@types/shared/common.d.ts +0 -2
- package/@types/shared/hof.d.ts +0 -6
- package/@types/shared/interface.d.ts +0 -4
- package/@types/{router/common → shared}/queue.d.ts +2 -2
- package/@types/shared/url-utils/interface.d.ts +0 -1
- package/@types/shared/url-utils/url-utils.d.ts +0 -5
- package/@types/shared/utils.d.ts +29 -6
- package/CHANGELOG.md +0 -72
- package/CONTRIBUTING.md +0 -1
- package/DEVELOPERS.md +0 -1
- package/Makefile +6 -3
- package/TRIAGING.md +0 -1
- package/dist/angular-ts.esm.js +1048 -1150
- package/dist/angular-ts.umd.js +1048 -1150
- package/dist/angular-ts.umd.min.js +1 -1
- package/docs/assets/scss/index.scss +23 -0
- package/docs/content/_index.md +9 -8
- package/docs/content/docs/_index.md +1 -1
- package/docs/content/docs/directive/app.md +1 -1
- package/docs/content/docs/directive/bind.md +1 -1
- package/docs/content/docs/directive/blur.md +1 -1
- package/docs/content/docs/directive/channel.md +2 -2
- package/docs/content/docs/directive/class-even.md +1 -1
- package/docs/content/docs/directive/class-odd.md +1 -1
- package/docs/content/docs/directive/class.md +1 -1
- package/docs/content/docs/directive/click.md +1 -1
- package/docs/content/docs/directive/copy.md +1 -1
- package/docs/content/docs/directive/cut.md +1 -1
- package/docs/content/docs/directive/dblclick.md +1 -1
- package/docs/content/docs/directive/focus.md +1 -1
- package/docs/content/docs/directive/get.md +3 -3
- package/docs/content/docs/directive/keydown.md +1 -1
- package/docs/content/docs/directive/keyup.md +1 -1
- package/docs/content/docs/directive/load.md +1 -1
- package/docs/content/docs/directive/mousedown.md +1 -1
- package/docs/content/docs/directive/mouseenter.md +1 -1
- package/docs/content/docs/directive/mouseleave.md +1 -1
- package/docs/content/docs/directive/mousemove.md +1 -1
- package/docs/content/docs/directive/mouseout.md +1 -1
- package/docs/content/docs/directive/mouseover.md +1 -1
- package/docs/content/docs/directive/mouseup.md +1 -1
- package/docs/content/docs/directive/non-bindable.md +28 -0
- package/docs/content/docs/provider/locationProvider.md +26 -0
- package/docs/content/docs/provider/templateCacheProvider.md +2 -2
- package/docs/content/docs/service/location.md +57 -0
- package/docs/content/docs/service/url.md +5 -0
- package/docs/layouts/partials/hooks/head-end.html +1 -1
- package/docs/layouts/shortcodes/version.html +1 -0
- package/docs/static/examples/counter/counter-test.html +0 -4
- package/docs/static/examples/eventbus/eventbus-test.html +0 -4
- package/docs/static/examples/ng-non-bindable/ng-non-bindable-test.html +13 -0
- package/docs/static/examples/ng-non-bindable/ng-non-bindable.html +3 -0
- package/docs/static/examples/ng-non-bindable/ng-non-bindable.test.js +11 -0
- package/docs/static/typedoc/assets/hierarchy.js +1 -1
- package/docs/static/typedoc/assets/highlight.css +6 -6
- package/docs/static/typedoc/assets/navigation.js +1 -1
- package/docs/static/typedoc/assets/search.js +1 -1
- package/docs/static/typedoc/classes/Location.html +55 -0
- package/docs/static/typedoc/classes/LocationProvider.html +20 -0
- package/docs/static/typedoc/classes/NgModule.html +3 -3
- package/docs/static/typedoc/index.html +1 -1
- package/docs/static/typedoc/interfaces/DefaultPorts.html +5 -0
- package/docs/static/typedoc/interfaces/Html5Mode.html +23 -0
- package/docs/static/typedoc/interfaces/Provider.html +2 -1
- package/docs/static/typedoc/interfaces/UrlParts.html +9 -0
- package/docs/static/typedoc/types/AnnotatedFactory.html +1 -1
- package/docs/static/typedoc/types/Expression.html +1 -1
- package/docs/static/typedoc/types/Injectable.html +4 -1
- package/docs/static/typedoc/types/InjectableFactory.html +1 -4
- package/docs/static/typedoc/types/UrlChangeListener.html +5 -0
- package/docs/static/version.js +13 -0
- package/docs/test-results/.last-run.json +4 -0
- package/docs/test-results/static-examples-counter-counter-counter-example/error-context.md +50 -0
- package/package.json +2 -2
- package/src/{loader.js → angular.js} +11 -11
- package/src/angular.spec.js +189 -21
- package/src/animations/animate-css.js +17 -18
- package/src/animations/animate.spec.js +1 -1
- package/src/animations/shared.js +2 -3
- package/src/binding.spec.js +1 -1
- package/src/core/compile/compile.js +4 -7
- package/src/core/compile/compile.spec.js +1 -1
- package/src/core/controller/controller.spec.js +1 -1
- package/src/core/controller/controller.test.js +1 -0
- package/src/core/di/injector.js +7 -8
- package/src/core/di/injector.spec.js +2 -2
- package/src/core/di/injector.test.js +2 -2
- package/src/core/di/internal-injector.js +3 -6
- package/src/core/di/ng-module.js +26 -21
- package/src/core/filter/filter.js +1 -1
- package/src/core/filter/filter.spec.js +1 -1
- package/src/core/filter/filter.test.js +1 -0
- package/src/core/interpolate/interpolate.js +4 -6
- package/src/core/interpolate/interpolate.spec.js +1 -1
- package/src/core/interpolate/interpolate.test.js +1 -0
- package/src/core/parse/ast/ast.spec.js +1 -1
- package/src/core/parse/ast/ast.test.js +1 -1
- package/src/core/parse/lexer/lexer.spec.js +1 -1
- package/src/core/parse/parse.js +150 -146
- package/src/core/parse/parse.spec.js +46 -46
- package/src/core/prop.spec.js +1 -1
- package/src/core/root-element.spec.js +1 -1
- package/src/core/scope/scope.js +10 -11
- package/src/core/scope/scope.spec.js +3 -4
- package/src/directive/aria/aria.spec.js +1 -1
- package/src/directive/aria/aria.test.js +1 -0
- package/src/directive/attrs/attrs.spec.js +1 -1
- package/src/directive/attrs/attrs.test.js +1 -0
- package/src/directive/attrs/boolean.spec.js +1 -1
- package/src/directive/attrs/boolean.test.js +1 -0
- package/src/directive/attrs/element-style.spec.js +1 -1
- package/src/directive/attrs/element-style.test.js +1 -0
- package/src/directive/attrs/src.spec.js +1 -1
- package/src/directive/attrs/src.test.js +1 -0
- package/src/directive/bind/bind-html.spec.js +1 -1
- package/src/directive/bind/bind.js +1 -0
- package/src/directive/bind/bind.spec.js +1 -1
- package/src/directive/bind/bind.test.js +1 -0
- package/src/directive/channel/channel.spec.js +1 -1
- package/src/directive/channel/channel.test.js +1 -0
- package/src/directive/class/class.spec.js +1 -1
- package/src/directive/class/class.test.js +1 -0
- package/src/directive/cloak/cloak.spec.js +1 -1
- package/src/directive/cloak/cloak.test.js +1 -0
- package/src/directive/controller/controller.spec.js +1 -1
- package/src/directive/controller/controller.test.js +1 -0
- package/src/directive/events/click.spec.js +1 -1
- package/src/directive/events/event.spec.js +6 -6
- package/src/directive/events/events.test.js +1 -0
- package/src/directive/form/form.js +8 -5
- package/src/directive/form/form.spec.js +1 -1
- package/src/directive/form/form.test.js +1 -0
- package/src/directive/http/delete.spec.js +1 -1
- package/src/directive/http/form-test.html +18 -0
- package/src/directive/http/get.spec.js +1 -1
- package/src/directive/http/http.js +12 -3
- package/src/directive/http/post.spec.js +504 -9
- package/src/directive/http/put.spec.js +1 -1
- package/src/directive/if/if.spec.js +1 -1
- package/src/directive/include/include.spec.js +1 -1
- package/src/directive/init/init.spec.js +1 -1
- package/src/directive/init/init.test.js +1 -0
- package/src/directive/input/input.js +13 -15
- package/src/directive/input/input.spec.js +1 -2
- package/src/directive/input/input.test.js +1 -0
- package/src/directive/messages/messages.md +0 -4
- package/src/directive/messages/messages.spec.js +1 -1
- package/src/directive/messages/messages.test.js +1 -0
- package/src/directive/model/model.js +13 -13
- package/src/directive/model/model.spec.js +1 -1
- package/src/directive/model/model.test.js +1 -0
- package/src/directive/model-options/model-option.test.js +1 -0
- package/src/directive/model-options/model-options.js +1 -1
- package/src/directive/model-options/model-options.spec.js +1 -1
- package/src/directive/non-bindable/non-bindable.spec.js +1 -1
- package/src/directive/non-bindable/non-bindable.test.js +1 -0
- package/src/directive/observe/observe.spec.js +1 -1
- package/src/directive/observe/observe.test.js +1 -0
- package/src/directive/on/on.spec.js +1 -1
- package/src/directive/on/on.test.js +1 -0
- package/src/directive/options/options.spec.js +1 -1
- package/src/directive/options/options.test.js +1 -0
- package/src/directive/ref/href.spec.js +1 -1
- package/src/directive/ref/href.test.js +2 -0
- package/src/directive/ref/ref.spec.js +1 -1
- package/src/directive/repeat/repeat.js +1 -1
- package/src/directive/repeat/repeat.spec.js +2 -3
- package/src/directive/repeat/repeat.test.js +1 -0
- package/src/directive/script/script.spec.js +1 -1
- package/src/directive/script/script.test.js +1 -0
- package/src/directive/select/select.js +1 -1
- package/src/directive/select/select.spec.js +1 -1
- package/src/directive/select/select.test.js +1 -0
- package/src/directive/setter/setter.spec.js +1 -1
- package/src/directive/setter/setter.test.js +1 -0
- package/src/directive/show-hide/show-hide.spec.js +1 -1
- package/src/directive/show-hide/show-hide.test.js +1 -0
- package/src/directive/style/style.spec.js +1 -1
- package/src/directive/style/style.test.js +1 -0
- package/src/directive/switch/switch.spec.js +1 -1
- package/src/directive/switch/switch.test.js +1 -0
- package/src/directive/validators/validators.js +82 -84
- package/src/directive/validators/validators.spec.js +5 -4
- package/src/directive/validators/validators.test.js +1 -0
- package/src/filters/filter.spec.js +1 -1
- package/src/filters/filters.spec.js +1 -1
- package/src/filters/limit-to.js +2 -3
- package/src/filters/limit-to.spec.js +1 -1
- package/src/filters/order-by.spec.js +1 -1
- package/src/index.js +1 -1
- package/src/injection-tokens.js +7 -3
- package/src/interface.ts +4 -3
- package/src/loader.md +0 -155
- package/src/{public.js → ng.js} +11 -12
- package/src/{public.spec.js → ng.spec.js} +2 -2
- package/src/router/directives/state-directives.js +5 -5
- package/src/router/directives/state-directives.spec.js +8 -7
- package/src/router/directives/view-directive.js +7 -13
- package/src/router/directives/view-directive.spec.js +22 -23
- package/src/router/{common/common.html → glob/glob.html} +2 -3
- package/src/router/{common/common.test.js → glob/glob.test.js} +2 -1
- package/src/router/params/param-type.js +0 -1
- package/src/router/params/param.js +1 -1
- package/src/router/path/path-utils.js +5 -0
- package/src/router/router-test-hashbang.html +45 -0
- package/src/router/{globals.js → router.js} +2 -2
- package/src/router/services.spec.js +8 -9
- package/src/router/state/interface.ts +1 -1
- package/src/router/state/state-builder.js +3 -3
- package/src/router/state/state-builder.spec.js +1 -1
- package/src/router/state/state-object.js +1 -1
- package/src/router/state/state-registry.js +4 -4
- package/src/router/state/state-service.js +14 -14
- package/src/router/state/state.spec.js +23 -22
- package/src/router/state/state.test.js +1 -0
- package/src/router/state/views.js +1 -1
- package/src/router/state-filter.spec.js +1 -1
- package/src/router/state-filters.js +13 -9
- package/src/router/template-factory.js +5 -4
- package/src/router/template-factory.spec.js +7 -7
- package/src/router/transition/hook-registry.js +1 -1
- package/src/router/transition/transition-service.js +7 -6
- package/src/router/transition/transition.js +6 -6
- package/src/router/url/url-matcher.js +12 -14
- package/src/router/url/url-rule.js +8 -2
- package/src/router/url/url-rules.js +8 -5
- package/src/router/url/url-service.js +80 -76
- package/src/router/url/url-service.spec.js +61 -78
- package/src/router/url/url.test.js +1 -0
- package/src/router/view/view.js +4 -5
- package/src/router/view/view.spec.js +10 -12
- package/src/router/view/view.test.js +1 -0
- package/src/router/view-hook.spec.js +1 -1
- package/src/router/view-scroll.js +3 -1
- package/src/router/view-scroll.spec.js +12 -12
- package/src/services/anchor-scroll.html +2 -2
- package/src/services/anchor-scroll.js +5 -4
- package/src/services/http/http.js +9 -4
- package/src/services/http/http.spec.js +2 -7
- package/src/services/http/template-request.spec.js +1 -1
- package/src/services/http-backend/http-backend.js +51 -77
- package/src/services/http-backend/http-backend.spec.js +1 -2
- package/src/services/http-backend/http-backend.test.js +1 -0
- package/src/services/location/interface.ts +62 -0
- package/src/services/location/location.js +439 -519
- package/src/services/location/location.spec.js +915 -530
- package/src/services/location/location.test.js +2 -2
- package/src/services/log/log.spec.js +1 -1
- package/src/services/log/log.test.js +1 -0
- package/src/services/pubsub/pubsub.spec.js +1 -1
- package/src/services/sce/sce.js +5 -7
- package/src/services/sce/sce.md +2 -2
- package/src/services/sce/sce.spec.js +1 -1
- package/src/services/template-cache/template-cache.spec.js +1 -1
- package/src/services/template-cache/template-cache.test.js +1 -0
- package/src/shared/common.js +5 -10
- package/src/shared/common.spec.js +1 -1
- package/src/shared/hof.js +0 -14
- package/src/shared/interface.ts +0 -4
- package/src/{router/common → shared}/queue.js +7 -7
- package/src/shared/shared.html +1 -0
- package/src/shared/shared.test.js +1 -0
- package/src/shared/url-utils/interface.ts +0 -2
- package/src/shared/url-utils/url-utils.js +6 -30
- package/src/shared/url-utils/url-utils.spec.js +10 -9
- package/src/shared/utils.js +32 -9
- package/src/shared/utils.spec.js +35 -1
- package/src/src.html +1 -2
- package/typedoc.json +0 -1
- package/utils/express.js +27 -1
- package/utils/version.cjs +23 -0
- package/@types/router/state-provider.d.ts +0 -123
- package/src/directive/non-bindable/non-bindable.md +0 -17
- package/src/loader.spec.js +0 -169
- package/src/router/state-provider.js +0 -146
- package/src/services/location/location.md +0 -114
- package/src/shared/url-utils/url-utils.md +0 -46
- /package/@types/router/{common → glob}/glob.d.ts +0 -0
- /package/src/router/{common → glob}/glob.js +0 -0
- /package/src/router/{common → glob}/glob.spec.js +0 -0
- /package/src/{router/common → shared}/queue.spec.js +0 -0
|
@@ -139,7 +139,7 @@ const EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;
|
|
|
139
139
|
export const DirectiveSuffix = "Directive";
|
|
140
140
|
|
|
141
141
|
export class CompileProvider {
|
|
142
|
-
static $inject = ["$provide", "$$sanitizeUriProvider"];
|
|
142
|
+
/* @ignore */ static $inject = ["$provide", "$$sanitizeUriProvider"];
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
145
|
* @param {import('../../interface.js').Provider} $provide
|
|
@@ -1216,8 +1216,7 @@ export class CompileProvider {
|
|
|
1216
1216
|
// Null out all of these references for garbage collection
|
|
1217
1217
|
compileNodes = transcludeFn = previousCompileContext = null;
|
|
1218
1218
|
}
|
|
1219
|
-
|
|
1220
|
-
return linked;
|
|
1219
|
+
return compiled.apply(this, arguments);
|
|
1221
1220
|
};
|
|
1222
1221
|
}
|
|
1223
1222
|
|
|
@@ -1561,14 +1560,13 @@ export class CompileProvider {
|
|
|
1561
1560
|
// * `undefined` - a slot that was not declared (i.e. invalid)
|
|
1562
1561
|
const slotTranscludeFn = boundTranscludeFn.$$slots[slotName];
|
|
1563
1562
|
if (slotTranscludeFn) {
|
|
1564
|
-
|
|
1563
|
+
return slotTranscludeFn(
|
|
1565
1564
|
scope,
|
|
1566
1565
|
cloneAttachFn,
|
|
1567
1566
|
transcludeControllers,
|
|
1568
1567
|
futureParentElement,
|
|
1569
1568
|
scopeToChild,
|
|
1570
1569
|
);
|
|
1571
|
-
return slotTranscludeRes;
|
|
1572
1570
|
}
|
|
1573
1571
|
|
|
1574
1572
|
if (isUndefined(slotTranscludeFn)) {
|
|
@@ -1581,14 +1579,13 @@ export class CompileProvider {
|
|
|
1581
1579
|
);
|
|
1582
1580
|
}
|
|
1583
1581
|
} else {
|
|
1584
|
-
|
|
1582
|
+
return boundTranscludeFn(
|
|
1585
1583
|
scope,
|
|
1586
1584
|
cloneAttachFn,
|
|
1587
1585
|
transcludeControllers,
|
|
1588
1586
|
futureParentElement,
|
|
1589
1587
|
scopeToChild,
|
|
1590
1588
|
);
|
|
1591
|
-
return boundTranscludeRes;
|
|
1592
1589
|
}
|
|
1593
1590
|
}
|
|
1594
1591
|
};
|
|
@@ -5,6 +5,7 @@ const TEST_URL = "src/core/controller/controller.html";
|
|
|
5
5
|
test("unit tests contain no errors", async ({ page }) => {
|
|
6
6
|
await page.goto(TEST_URL);
|
|
7
7
|
await page.content();
|
|
8
|
+
await page.waitForTimeout(1000);
|
|
8
9
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
9
10
|
/0 failures/,
|
|
10
11
|
);
|
package/src/core/di/injector.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
+
assert,
|
|
3
|
+
assertArg,
|
|
2
4
|
assertArgFn,
|
|
3
|
-
|
|
5
|
+
assertNotHasOwnProperty,
|
|
4
6
|
isFunction,
|
|
7
|
+
isObject,
|
|
5
8
|
isString,
|
|
6
9
|
isUndefined,
|
|
7
|
-
|
|
8
|
-
assertNotHasOwnProperty,
|
|
9
|
-
isObject,
|
|
10
|
-
assert,
|
|
10
|
+
minErr,
|
|
11
11
|
} from "../../shared/utils.js";
|
|
12
12
|
import { INJECTOR_LITERAL } from "./ng-module.js";
|
|
13
|
-
import {
|
|
13
|
+
import { InjectorService, ProviderInjector } from "./internal-injector.js";
|
|
14
14
|
|
|
15
15
|
const ARROW_ARG = /^([^(]+?)=>/;
|
|
16
16
|
const FN_ARGS = /^[^(]*\(\s*([^)]*)\)/m;
|
|
@@ -252,8 +252,7 @@ function stringifyFn(fn) {
|
|
|
252
252
|
*/
|
|
253
253
|
function extractArgs(fn) {
|
|
254
254
|
const fnText = stringifyFn(fn).replace(STRIP_COMMENTS, "");
|
|
255
|
-
|
|
256
|
-
return args;
|
|
255
|
+
return fnText.match(ARROW_ARG) || fnText.match(FN_ARGS);
|
|
257
256
|
}
|
|
258
257
|
|
|
259
258
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Angular } from "../../
|
|
1
|
+
import { Angular } from "../../angular.js";
|
|
2
2
|
import { createInjector, annotate } from "./injector.js";
|
|
3
3
|
import { extend } from "../../shared/utils.js";
|
|
4
4
|
|
|
@@ -296,7 +296,7 @@ describe("injector.modules", () => {
|
|
|
296
296
|
module.constant("b", 2);
|
|
297
297
|
const injector = createInjector(["myModule"]);
|
|
298
298
|
class Foo {
|
|
299
|
-
static $inject = ["a", "b"];
|
|
299
|
+
/* @ignore */ static $inject = ["a", "b"];
|
|
300
300
|
constructor(a, b) {
|
|
301
301
|
this.c = a + b;
|
|
302
302
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { test, expect } from "@playwright/test";
|
|
2
2
|
|
|
3
|
-
const TEST_URL = "src/core/di/injector.html";
|
|
3
|
+
const TEST_URL = "src/core/di/injector.html?random=false";
|
|
4
4
|
|
|
5
5
|
test("unit tests contain no errors", async ({ page }) => {
|
|
6
6
|
await page.goto(TEST_URL);
|
|
7
7
|
await page.content();
|
|
8
|
-
await page.waitForTimeout(
|
|
8
|
+
await page.waitForTimeout(1000);
|
|
9
9
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
10
|
/0 failures/,
|
|
11
11
|
);
|
|
@@ -109,8 +109,7 @@ class AbstractInjector {
|
|
|
109
109
|
|
|
110
110
|
if (isClass(/** @type {Function} */ (fn))) {
|
|
111
111
|
args.unshift(null);
|
|
112
|
-
|
|
113
|
-
return res;
|
|
112
|
+
return new (Function.prototype.bind.apply(fn, args))();
|
|
114
113
|
} else {
|
|
115
114
|
return /** @type {Function} */ (fn).apply(self, args);
|
|
116
115
|
}
|
|
@@ -199,8 +198,7 @@ export class InjectorService extends AbstractInjector {
|
|
|
199
198
|
*/
|
|
200
199
|
factory(serviceName) {
|
|
201
200
|
const provider = this.providerInjector.get(serviceName + providerSuffix);
|
|
202
|
-
|
|
203
|
-
return res;
|
|
201
|
+
return this.invoke(provider.$get, provider, undefined, serviceName);
|
|
204
202
|
}
|
|
205
203
|
|
|
206
204
|
/**
|
|
@@ -234,8 +232,7 @@ function stringifyFn(fn) {
|
|
|
234
232
|
*/
|
|
235
233
|
function extractArgs(fn) {
|
|
236
234
|
const fnText = stringifyFn(fn).replace(STRIP_COMMENTS, "");
|
|
237
|
-
|
|
238
|
-
return args;
|
|
235
|
+
return fnText.match(ARROW_ARG) || fnText.match(FN_ARGS);
|
|
239
236
|
}
|
|
240
237
|
|
|
241
238
|
/**
|
package/src/core/di/ng-module.js
CHANGED
|
@@ -26,7 +26,7 @@ export class NgModule {
|
|
|
26
26
|
/**
|
|
27
27
|
* @param {string} name - Name of the module
|
|
28
28
|
* @param {Array<string>} requires - List of modules which the injector will load before the current module
|
|
29
|
-
* @param {
|
|
29
|
+
* @param {import("../../interface.js").Injectable} [configFn]
|
|
30
30
|
*/
|
|
31
31
|
constructor(name, requires, configFn) {
|
|
32
32
|
assert(isString(name), "name required");
|
|
@@ -52,7 +52,7 @@ export class NgModule {
|
|
|
52
52
|
/** @type {!Array<Array<*>>} */
|
|
53
53
|
this.configBlocks = [];
|
|
54
54
|
|
|
55
|
-
/** @type {!Array.<
|
|
55
|
+
/** @type {!Array.<import("../../interface.js").Injectable>} */
|
|
56
56
|
this.runBlocks = [];
|
|
57
57
|
|
|
58
58
|
if (configFn) {
|
|
@@ -82,7 +82,7 @@ export class NgModule {
|
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
*
|
|
85
|
-
* @param {
|
|
85
|
+
* @param {import("../../interface.js").Injectable} configFn
|
|
86
86
|
* @returns {NgModule}
|
|
87
87
|
*/
|
|
88
88
|
config(configFn) {
|
|
@@ -91,7 +91,7 @@ export class NgModule {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
* @param {
|
|
94
|
+
* @param {import("../../interface.js").Injectable} block
|
|
95
95
|
* @returns {NgModule}
|
|
96
96
|
*/
|
|
97
97
|
run(block) {
|
|
@@ -101,12 +101,12 @@ export class NgModule {
|
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
103
|
* @param {string} name
|
|
104
|
-
* @param {
|
|
104
|
+
* @param {import("../../interface.js").Injectable} options
|
|
105
105
|
* @returns {NgModule}
|
|
106
106
|
*/
|
|
107
107
|
component(name, options) {
|
|
108
108
|
if (options && isFunction(options)) {
|
|
109
|
-
options
|
|
109
|
+
options["$$moduleName"] = name;
|
|
110
110
|
}
|
|
111
111
|
this.invokeQueue.push([COMPILE_LITERAL, "component", [name, options]]);
|
|
112
112
|
return this;
|
|
@@ -114,12 +114,12 @@ export class NgModule {
|
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
116
|
* @param {string} name
|
|
117
|
-
* @param {
|
|
117
|
+
* @param {import("../../interface.js").Injectable} providerFunction
|
|
118
118
|
* @returns {NgModule}
|
|
119
119
|
*/
|
|
120
120
|
factory(name, providerFunction) {
|
|
121
121
|
if (providerFunction && isFunction(providerFunction)) {
|
|
122
|
-
providerFunction
|
|
122
|
+
providerFunction["$$moduleName"] = name;
|
|
123
123
|
}
|
|
124
124
|
this.invokeQueue.push([$t.$provide, "factory", [name, providerFunction]]);
|
|
125
125
|
return this;
|
|
@@ -127,12 +127,12 @@ export class NgModule {
|
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* @param {string} name
|
|
130
|
-
* @param {
|
|
130
|
+
* @param {import("../../interface.js").Injectable} serviceFunction
|
|
131
131
|
* @returns {NgModule}
|
|
132
132
|
*/
|
|
133
133
|
service(name, serviceFunction) {
|
|
134
134
|
if (serviceFunction && isFunction(serviceFunction)) {
|
|
135
|
-
serviceFunction
|
|
135
|
+
serviceFunction["$$moduleName"] = name;
|
|
136
136
|
}
|
|
137
137
|
this.invokeQueue.push([$t.$provide, "service", [name, serviceFunction]]);
|
|
138
138
|
return this;
|
|
@@ -140,12 +140,12 @@ export class NgModule {
|
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
142
|
* @param {string} name
|
|
143
|
-
* @param {
|
|
143
|
+
* @param {import("../../interface.js").Injectable} providerType
|
|
144
144
|
* @returns {NgModule}
|
|
145
145
|
*/
|
|
146
146
|
provider(name, providerType) {
|
|
147
147
|
if (providerType && isFunction(providerType)) {
|
|
148
|
-
providerType
|
|
148
|
+
providerType["$$moduleName"] = name;
|
|
149
149
|
}
|
|
150
150
|
this.invokeQueue.push([$t.$provide, "provider", [name, providerType]]);
|
|
151
151
|
return this;
|
|
@@ -153,12 +153,12 @@ export class NgModule {
|
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
155
|
* @param {string} name
|
|
156
|
-
* @param {
|
|
156
|
+
* @param {import("../../interface.js").Injectable} decorFn
|
|
157
157
|
* @returns {NgModule}
|
|
158
158
|
*/
|
|
159
159
|
decorator(name, decorFn) {
|
|
160
160
|
if (decorFn && isFunction(decorFn)) {
|
|
161
|
-
decorFn
|
|
161
|
+
decorFn["$$moduleName"] = name;
|
|
162
162
|
}
|
|
163
163
|
this.configBlocks.push([$t.$provide, "decorator", [name, decorFn]]);
|
|
164
164
|
return this;
|
|
@@ -166,12 +166,12 @@ export class NgModule {
|
|
|
166
166
|
|
|
167
167
|
/**
|
|
168
168
|
* @param {string} name
|
|
169
|
-
* @param {
|
|
169
|
+
* @param {import("../../interface.js").Injectable} directiveFactory
|
|
170
170
|
* @returns {NgModule}
|
|
171
171
|
*/
|
|
172
172
|
directive(name, directiveFactory) {
|
|
173
173
|
if (directiveFactory && isFunction(directiveFactory)) {
|
|
174
|
-
directiveFactory
|
|
174
|
+
directiveFactory["$$moduleName"] = name;
|
|
175
175
|
}
|
|
176
176
|
this.invokeQueue.push([
|
|
177
177
|
COMPILE_LITERAL,
|
|
@@ -183,12 +183,12 @@ export class NgModule {
|
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
185
|
* @param {string} name
|
|
186
|
-
* @param {
|
|
186
|
+
* @param {import("../../interface.js").Injectable} animationFactory
|
|
187
187
|
* @returns {NgModule}
|
|
188
188
|
*/
|
|
189
189
|
animation(name, animationFactory) {
|
|
190
190
|
if (animationFactory && isFunction(animationFactory)) {
|
|
191
|
-
animationFactory
|
|
191
|
+
animationFactory["$$moduleName"] = name;
|
|
192
192
|
}
|
|
193
193
|
this.invokeQueue.push([
|
|
194
194
|
ANIMATION_LITERAL,
|
|
@@ -198,9 +198,14 @@ export class NgModule {
|
|
|
198
198
|
return this;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
+
/**
|
|
202
|
+
* @param {string} name
|
|
203
|
+
* @param {import("../../interface.js").Injectable} filterFn
|
|
204
|
+
* @return {NgModule}
|
|
205
|
+
*/
|
|
201
206
|
filter(name, filterFn) {
|
|
202
207
|
if (filterFn && isFunction(filterFn)) {
|
|
203
|
-
filterFn
|
|
208
|
+
filterFn["$$moduleName"] = name;
|
|
204
209
|
}
|
|
205
210
|
this.invokeQueue.push([FILTER_LITERAL, "register", [name, filterFn]]);
|
|
206
211
|
return this;
|
|
@@ -208,12 +213,12 @@ export class NgModule {
|
|
|
208
213
|
|
|
209
214
|
/**
|
|
210
215
|
* @param {string} name
|
|
211
|
-
* @param {
|
|
216
|
+
* @param {import("../../interface.js").Injectable} ctlFn
|
|
212
217
|
* @returns {NgModule}
|
|
213
218
|
*/
|
|
214
219
|
controller(name, ctlFn) {
|
|
215
220
|
if (ctlFn && isFunction(ctlFn)) {
|
|
216
|
-
ctlFn
|
|
221
|
+
ctlFn["$$moduleName"] = name;
|
|
217
222
|
}
|
|
218
223
|
this.invokeQueue.push([CONTROLLER_LITERAL, "register", [name, ctlFn]]);
|
|
219
224
|
return this;
|
|
@@ -5,6 +5,7 @@ const TEST_URL = "src/core/filter/filter.html";
|
|
|
5
5
|
test("unit tests contain no errors", async ({ page }) => {
|
|
6
6
|
await page.goto(TEST_URL);
|
|
7
7
|
await page.content();
|
|
8
|
+
await page.waitForTimeout(1000);
|
|
8
9
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
9
10
|
/0 failures/,
|
|
10
11
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
extend,
|
|
3
3
|
isDefined,
|
|
4
4
|
isUndefined,
|
|
5
|
+
minErr,
|
|
5
6
|
stringify,
|
|
6
|
-
extend,
|
|
7
7
|
} from "../../shared/utils.js";
|
|
8
8
|
import { constantWatchDelegate } from "../parse/parse.js";
|
|
9
9
|
|
|
@@ -322,8 +322,7 @@ export class InterpolateProvider {
|
|
|
322
322
|
let j = 0;
|
|
323
323
|
for (; j < ii; j++) {
|
|
324
324
|
let fn = parseFns[j];
|
|
325
|
-
|
|
326
|
-
vals[j] = res;
|
|
325
|
+
vals[j] = fn(context);
|
|
327
326
|
}
|
|
328
327
|
cb(compute(vals));
|
|
329
328
|
});
|
|
@@ -332,8 +331,7 @@ export class InterpolateProvider {
|
|
|
332
331
|
values[i] = parseFns[i](context);
|
|
333
332
|
}
|
|
334
333
|
|
|
335
|
-
|
|
336
|
-
return res;
|
|
334
|
+
return compute(values);
|
|
337
335
|
} catch (err) {
|
|
338
336
|
interr(text, err);
|
|
339
337
|
}
|
|
@@ -5,6 +5,7 @@ const TEST_URL = "src/core/interpolate/interpolate.html";
|
|
|
5
5
|
test("unit tests contain no errors", async ({ page }) => {
|
|
6
6
|
await page.goto(TEST_URL);
|
|
7
7
|
await page.content();
|
|
8
|
+
await page.waitForTimeout(1000);
|
|
8
9
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
9
10
|
/0 failures/,
|
|
10
11
|
);
|
|
@@ -2,7 +2,7 @@ import { AST } from "./ast.js";
|
|
|
2
2
|
import { Lexer } from "../lexer/lexer.js";
|
|
3
3
|
import { createInjector } from "../../di/injector.js";
|
|
4
4
|
import { ASTType } from "../ast-type.js";
|
|
5
|
-
import { Angular } from "../../../
|
|
5
|
+
import { Angular } from "../../../angular.js";
|
|
6
6
|
|
|
7
7
|
describe("ast", () => {
|
|
8
8
|
let $rootScope;
|
|
@@ -3,7 +3,7 @@ import { test, expect } from "@playwright/test";
|
|
|
3
3
|
test("lexer unit tests contain no errors", async ({ page }) => {
|
|
4
4
|
await page.goto("src/core/parse/ast/ast.html");
|
|
5
5
|
await page.content();
|
|
6
|
-
await page.waitForTimeout(
|
|
6
|
+
await page.waitForTimeout(3000);
|
|
7
7
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
8
8
|
/0 failures/,
|
|
9
9
|
);
|