@angular-wave/angular.ts 0.8.1 → 0.8.3
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/core/compile/compile.d.ts +5 -2
- package/@types/core/di/ng-module.d.ts +2 -2
- package/@types/interface.d.ts +3 -2
- package/dist/angular-ts.esm.js +4 -4
- package/dist/angular-ts.umd.js +4 -4
- package/dist/angular-ts.umd.min.js +1 -1
- package/docs/layouts/shortcodes/version.html +1 -1
- package/docs/static/typedoc/assets/hierarchy.js +1 -1
- package/docs/static/typedoc/assets/navigation.js +1 -1
- package/docs/static/typedoc/assets/search.js +1 -1
- package/docs/static/typedoc/assets/style.css +2 -9
- package/docs/static/typedoc/classes/NgModule.html +1 -1
- package/docs/static/typedoc/hierarchy.html +1 -1
- package/docs/static/typedoc/index.html +1 -1
- package/docs/static/typedoc/interfaces/HttpProviderDefaults.html +1 -1
- package/docs/static/typedoc/interfaces/RequestConfig.html +1 -1
- package/docs/static/typedoc/interfaces/RequestShortcutConfig.html +1 -1
- package/docs/static/typedoc/types/Injectable.html +1 -1
- package/docs/static/typedoc/types/InjectableClass.html +1 -0
- package/package.json +1 -1
- package/src/angular.spec.js +4 -4
- package/src/core/compile/compile.js +1 -1
- package/src/core/di/ng-module.js +1 -1
- package/src/interface.ts +3 -2
- package/src/shared/min-err.spec.js +1 -1
- package/src/shared/url-utils/url-utils.spec.js +0 -1
- package/src/shared/utils.spec.js +4 -4
- package/tsconfig.json +1 -7
package/src/angular.spec.js
CHANGED
|
@@ -28,11 +28,11 @@ import { createInjector } from "./core/di/injector.js";
|
|
|
28
28
|
import { wait } from "./shared/test-utils.js";
|
|
29
29
|
|
|
30
30
|
describe("angular", () => {
|
|
31
|
-
let element, document, module, injector, $rootScope, $compile;
|
|
31
|
+
let element, document, module, injector, $rootScope, $compile, angular;
|
|
32
32
|
|
|
33
33
|
beforeEach(() => {
|
|
34
|
-
|
|
35
|
-
module =
|
|
34
|
+
angular = new Angular();
|
|
35
|
+
module = angular.module("defaultModule", ["ng"]);
|
|
36
36
|
injector = createInjector(["ng", "defaultModule"]);
|
|
37
37
|
$rootScope = injector.get("$rootScope");
|
|
38
38
|
$compile = injector.get("$compile");
|
|
@@ -1026,7 +1026,7 @@ describe("angular", () => {
|
|
|
1026
1026
|
describe("module loader", () => {
|
|
1027
1027
|
let angular;
|
|
1028
1028
|
beforeEach(() => {
|
|
1029
|
-
angular =
|
|
1029
|
+
angular = new Angular();
|
|
1030
1030
|
});
|
|
1031
1031
|
|
|
1032
1032
|
it("allows registering a module", () => {
|
|
@@ -333,7 +333,7 @@ export class CompileProvider {
|
|
|
333
333
|
/**
|
|
334
334
|
* @param {string|Object} name Name of the component in camelCase (i.e. `myComp` which will match `<my-comp>`),
|
|
335
335
|
* or an object map of components where the keys are the names and the values are the component definition objects.
|
|
336
|
-
* @param {
|
|
336
|
+
* @param {import("../../interface.js").ComponentOptions} options Component definition object (a simplified
|
|
337
337
|
* {directive definition object}),
|
|
338
338
|
* with the following properties (all optional):
|
|
339
339
|
*
|
package/src/core/di/ng-module.js
CHANGED
|
@@ -101,7 +101,7 @@ export class NgModule {
|
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
103
|
* @param {string} name
|
|
104
|
-
* @param {import("../../interface.js").
|
|
104
|
+
* @param {import("../../interface.js").ComponentOptions} options
|
|
105
105
|
* @returns {NgModule}
|
|
106
106
|
*/
|
|
107
107
|
component(name, options) {
|
package/src/interface.ts
CHANGED
|
@@ -38,14 +38,15 @@ export type ExpandoStore = {
|
|
|
38
38
|
*/
|
|
39
39
|
export type AnnotatedFactory = [...string[], (...args: any[]) => any];
|
|
40
40
|
export type InjectableFactory = (...args: any[]) => any;
|
|
41
|
+
export type InjectableClass = new (...args: any[]) => any;
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
|
-
* A factory that can be either a standalone function or a dependency-annotated array.
|
|
44
|
+
* A factory that can be either a standalone function or a dependency-annotated array or a class (constructor function).
|
|
44
45
|
*
|
|
45
46
|
* The array form is used to support minification-safe dependency injection.
|
|
46
47
|
* See {@link AnnotatedFactory}.
|
|
47
48
|
*/
|
|
48
|
-
export type Injectable = AnnotatedFactory | InjectableFactory;
|
|
49
|
+
export type Injectable = AnnotatedFactory | InjectableFactory | InjectableClass;
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* An object that defines how a service is constructed.
|
|
@@ -10,7 +10,6 @@ describe("urlUtils", () => {
|
|
|
10
10
|
it("should returned already parsed URLs unchanged", () => {
|
|
11
11
|
const urlObj = urlResolve("/foo?bar=baz#qux");
|
|
12
12
|
expect(urlResolve(urlObj)).toBe(urlObj);
|
|
13
|
-
expect(urlResolve(true)).toBe(true);
|
|
14
13
|
expect(urlResolve(null)).toBeNull();
|
|
15
14
|
expect(urlResolve(undefined)).toBeUndefined();
|
|
16
15
|
});
|
package/src/shared/utils.spec.js
CHANGED
|
@@ -123,22 +123,22 @@ describe("api", () => {
|
|
|
123
123
|
});
|
|
124
124
|
|
|
125
125
|
it("uses preassigned $$hashKey", () => {
|
|
126
|
-
expect(hashKey({ $$hashKey: 42 })).toEqual(42);
|
|
126
|
+
expect(hashKey({ $$hashKey: "42" })).toEqual("42");
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
it("supports a function $$hashKey", function () {
|
|
130
|
-
expect(hashKey({ $$hashKey: () => 42 })).toEqual(42);
|
|
130
|
+
expect(hashKey({ $$hashKey: () => "42" })).toEqual("42");
|
|
131
131
|
});
|
|
132
132
|
|
|
133
133
|
it("calls the function $$hashKey as a method with the correct this", () => {
|
|
134
134
|
expect(
|
|
135
135
|
hashKey({
|
|
136
|
-
myKey: 42,
|
|
136
|
+
myKey: "42",
|
|
137
137
|
$$hashKey: function () {
|
|
138
138
|
return this.myKey;
|
|
139
139
|
},
|
|
140
140
|
}),
|
|
141
|
-
).toEqual(42);
|
|
141
|
+
).toEqual("42");
|
|
142
142
|
});
|
|
143
143
|
});
|
|
144
144
|
|
package/tsconfig.json
CHANGED
|
@@ -15,11 +15,5 @@
|
|
|
15
15
|
"typeRoots": ["node_modules/@types"]
|
|
16
16
|
},
|
|
17
17
|
"include": ["src"],
|
|
18
|
-
"exclude": [
|
|
19
|
-
"**/*.d.ts",
|
|
20
|
-
"node_modules",
|
|
21
|
-
"types/**",
|
|
22
|
-
"**/*.test.js",
|
|
23
|
-
"**/*.spec.js"
|
|
24
|
-
]
|
|
18
|
+
"exclude": ["**/*.d.ts", "node_modules", "**/*.spec.js", "**/*.test.js"]
|
|
25
19
|
}
|