@angular-wave/angular.ts 0.12.0 → 0.14.0
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/angular.d.ts +3 -3
- package/@types/animations/animation.d.ts +1 -1
- package/@types/animations/raf-scheduler.d.ts +1 -3
- package/@types/core/compile/attributes.d.ts +2 -2
- package/@types/core/compile/compile.d.ts +2 -2
- package/@types/core/di/ng-module/ng-module.d.ts +33 -36
- package/@types/core/filter/filter.d.ts +12 -13
- package/@types/core/scope/interface.d.ts +1 -1
- package/@types/core/scope/scope.d.ts +9 -10
- package/@types/directive/aria/aria.d.ts +3 -3
- package/@types/directive/bind/bind.d.ts +2 -2
- package/@types/directive/class/class.d.ts +3 -3
- package/@types/directive/events/events.d.ts +2 -2
- package/@types/directive/form/form.d.ts +12 -2
- package/@types/directive/include/include.d.ts +4 -4
- package/@types/directive/input/input.d.ts +2 -2
- package/@types/directive/messages/messages.d.ts +1 -1
- package/@types/directive/model/model.d.ts +26 -20
- package/@types/directive/model-options/model-options.d.ts +4 -1
- package/@types/directive/options/options.d.ts +4 -4
- package/@types/directive/select/select.d.ts +1 -1
- package/@types/directive/style/style.d.ts +2 -2
- package/@types/directive/worker/interface.d.ts +2 -0
- package/@types/directive/worker/worker.d.ts +2 -0
- package/@types/filters/interface.d.ts +7 -1
- package/@types/interface.d.ts +66 -34
- package/@types/namespace.d.ts +60 -13
- package/@types/router/common/trace.d.ts +1 -0
- package/@types/router/directives/view-directive.d.ts +2 -2
- package/@types/router/transition/transition.d.ts +0 -1
- package/@types/router/url/url-config.d.ts +1 -1
- package/@types/router/url/url-rule.d.ts +0 -10
- package/@types/router/url/url-service.d.ts +3 -6
- package/@types/router/view/view.d.ts +0 -16
- package/@types/services/anchor-scroll/anchor-scroll.d.ts +1 -1
- package/@types/services/cookie/cookie.d.ts +80 -0
- package/@types/services/cookie/interface.d.ts +12 -0
- package/@types/services/exception/exception.d.ts +56 -0
- package/@types/services/exception/interface.d.ts +3 -3
- package/@types/services/http/http.d.ts +10 -2
- package/@types/services/location/location.d.ts +10 -6
- package/@types/services/pubsub/pubsub.d.ts +2 -1
- package/@types/services/rest/interface.d.ts +17 -0
- package/@types/services/rest/rest.d.ts +106 -0
- package/@types/services/rest/rfc.d.ts +40 -0
- package/@types/services/sce/sce.d.ts +1 -1
- package/@types/services/storage/interface.d.ts +1 -0
- package/@types/shared/common.d.ts +1 -1
- package/@types/shared/dom.d.ts +8 -11
- package/@types/shared/hof.d.ts +2 -2
- package/@types/shared/interface.d.ts +1 -0
- package/@types/shared/noderef.d.ts +1 -0
- package/@types/shared/strings.d.ts +6 -8
- package/@types/shared/utils.d.ts +73 -25
- package/LICENSE +1 -0
- package/README.md +3 -90
- package/dist/angular-ts.esm.js +10120 -6051
- package/dist/angular-ts.umd.js +10120 -6051
- package/dist/angular-ts.umd.min.js +1 -1
- package/package.json +1 -6
- package/@types/services/exception/exception-handler.d.ts +0 -58
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @template T, ID
|
|
3
|
+
*/
|
|
4
|
+
export class RestService<T, ID> {
|
|
5
|
+
static $nonscope: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Core REST service for CRUD operations.
|
|
8
|
+
* Safe, predictable, and optionally maps raw JSON to entity class instances.
|
|
9
|
+
*
|
|
10
|
+
* @param {ng.HttpService} $http Angular-like $http service
|
|
11
|
+
* @param {string} baseUrl Base URL or URI template
|
|
12
|
+
* @param {ng.EntityClass<T>} [entityClass] Optional constructor to map JSON to objects
|
|
13
|
+
* @param {Object} [options] Optional settings (interceptors, headers, etc.)
|
|
14
|
+
*/
|
|
15
|
+
constructor(
|
|
16
|
+
$http: ng.HttpService,
|
|
17
|
+
baseUrl: string,
|
|
18
|
+
entityClass?: ng.EntityClass<T>,
|
|
19
|
+
options?: any,
|
|
20
|
+
);
|
|
21
|
+
/** @private */
|
|
22
|
+
private $http;
|
|
23
|
+
/** @private */
|
|
24
|
+
private baseUrl;
|
|
25
|
+
/** @private */
|
|
26
|
+
private entityClass;
|
|
27
|
+
/** @private */
|
|
28
|
+
private options;
|
|
29
|
+
/**
|
|
30
|
+
* Build full URL from template and parameters
|
|
31
|
+
* @param {string} template
|
|
32
|
+
* @param {Record<string, any>} params
|
|
33
|
+
* @returns {string}
|
|
34
|
+
*/
|
|
35
|
+
buildUrl(template: string, params: Record<string, any>): string;
|
|
36
|
+
/**
|
|
37
|
+
* List entities
|
|
38
|
+
* @param {Record<string, any>=} params
|
|
39
|
+
* @returns {Promise<T[]>}
|
|
40
|
+
*/
|
|
41
|
+
list(params?: Record<string, any> | undefined): Promise<T[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Read single entity by ID
|
|
44
|
+
* @param {ID} id
|
|
45
|
+
* @param {Record<string, any>=} params
|
|
46
|
+
* @returns {Promise<T|null>}
|
|
47
|
+
*/
|
|
48
|
+
read(id: ID, params?: Record<string, any> | undefined): Promise<T | null>;
|
|
49
|
+
/**
|
|
50
|
+
* Create a new entity
|
|
51
|
+
* @param {T} item
|
|
52
|
+
* @returns {Promise<T>}
|
|
53
|
+
*/
|
|
54
|
+
create(item: T): Promise<T>;
|
|
55
|
+
/**
|
|
56
|
+
* Update entity by ID
|
|
57
|
+
* @param {ID} id
|
|
58
|
+
* @param {Partial<T>} item
|
|
59
|
+
* @returns {Promise<T|null>}
|
|
60
|
+
*/
|
|
61
|
+
update(id: ID, item: Partial<T>): Promise<T | null>;
|
|
62
|
+
/**
|
|
63
|
+
* Delete entity by ID
|
|
64
|
+
* @param {ID} id
|
|
65
|
+
* @returns {Promise<boolean>}
|
|
66
|
+
*/
|
|
67
|
+
delete(id: ID): Promise<boolean>;
|
|
68
|
+
#private;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Provider for registering REST endpoints during module configuration.
|
|
72
|
+
*/
|
|
73
|
+
export class RestProvider {
|
|
74
|
+
/** @private @type {ng.RestDefinition<any>[]} */
|
|
75
|
+
private definitions;
|
|
76
|
+
/**
|
|
77
|
+
* Register a REST resource at config phase
|
|
78
|
+
* @template T
|
|
79
|
+
* @param {string} name Service name
|
|
80
|
+
* @param {string} url Base URL or URI template
|
|
81
|
+
* @param {{new(data:any):T}=} entityClass Optional entity constructor
|
|
82
|
+
* @param {Object=} options Optional service options
|
|
83
|
+
*/
|
|
84
|
+
rest<T>(
|
|
85
|
+
name: string,
|
|
86
|
+
url: string,
|
|
87
|
+
entityClass?:
|
|
88
|
+
| {
|
|
89
|
+
new (data: any): T;
|
|
90
|
+
}
|
|
91
|
+
| undefined,
|
|
92
|
+
options?: any | undefined,
|
|
93
|
+
): void;
|
|
94
|
+
/**
|
|
95
|
+
* $get factory: returns a factory function and allows access to named services
|
|
96
|
+
* @returns {(baseUrl:string, entityClass?:Function, options?:object) => RestService & { get(name:string): RestService, listNames(): string[] }}
|
|
97
|
+
*/
|
|
98
|
+
$get: (
|
|
99
|
+
| string
|
|
100
|
+
| (($http: any) => {
|
|
101
|
+
(baseUrl: any, entityClass: any, options?: {}): RestService<any, any>;
|
|
102
|
+
get(name: any): any;
|
|
103
|
+
listNames(): any[];
|
|
104
|
+
})
|
|
105
|
+
)[];
|
|
106
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RFC 6570 Level 4 URI Template expander
|
|
3
|
+
*
|
|
4
|
+
* Supports operators: (none), +, #, ., /, ;, ?, &
|
|
5
|
+
* Supports varspec modifiers: explode (*) and prefix (:len)
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* expandUriTemplate("/users/{id}", { id: 10 }) === "/users/10"
|
|
9
|
+
* expandUriTemplate("/search{?q,lang}", { q: "a b", lang: "en" }) === "/search?q=a%20b&lang=en"
|
|
10
|
+
* expandUriTemplate("/repos/{owner}/{repo}/issues{?labels*}", { labels: ["bug","ui"] }) === "/repos/x/y/issues?labels=bug&labels=ui"
|
|
11
|
+
*
|
|
12
|
+
* @param {string} template
|
|
13
|
+
* @param {Object<string, any>} vars
|
|
14
|
+
* @returns {string}
|
|
15
|
+
*/
|
|
16
|
+
export function expandUriTemplate(
|
|
17
|
+
template: string,
|
|
18
|
+
vars?: {
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
},
|
|
21
|
+
): string;
|
|
22
|
+
/**
|
|
23
|
+
* Helper: percent-encode a string. If allowReserved true, reserved chars are NOT encoded.
|
|
24
|
+
* @param {string} str
|
|
25
|
+
* @param {boolean} allowReserved
|
|
26
|
+
* @returns {string}
|
|
27
|
+
*/
|
|
28
|
+
export function pctEncode(str: string, allowReserved: boolean): string;
|
|
29
|
+
/**
|
|
30
|
+
* Parse and expand a single expression (content between { and }).
|
|
31
|
+
* @param {string} expression
|
|
32
|
+
* @param {Object<string, any>} vars
|
|
33
|
+
* @returns {string}
|
|
34
|
+
*/
|
|
35
|
+
export function expandExpression(
|
|
36
|
+
expression: string,
|
|
37
|
+
vars: {
|
|
38
|
+
[x: string]: any;
|
|
39
|
+
},
|
|
40
|
+
): string;
|
package/@types/shared/dom.d.ts
CHANGED
|
@@ -106,11 +106,11 @@ export function getScope(element: Element): ng.Scope;
|
|
|
106
106
|
* Set scope for a given element.
|
|
107
107
|
*
|
|
108
108
|
* @param {Element|Node|ChildNode} element - The DOM element to set data on.
|
|
109
|
-
* @param {
|
|
109
|
+
* @param {ng.Scope} scope - The Scope attached to this element
|
|
110
110
|
*/
|
|
111
111
|
export function setScope(
|
|
112
112
|
element: Element | Node | ChildNode,
|
|
113
|
-
scope:
|
|
113
|
+
scope: ng.Scope,
|
|
114
114
|
): void;
|
|
115
115
|
/**
|
|
116
116
|
* Gets isolate scope for a given element.
|
|
@@ -123,23 +123,20 @@ export function getIsolateScope(element: Element): any;
|
|
|
123
123
|
* Set isolate scope for a given element.
|
|
124
124
|
*
|
|
125
125
|
* @param {Element} element - The DOM element to set data on.
|
|
126
|
-
* @param {
|
|
126
|
+
* @param {ng.Scope} scope - The Scope attached to this element
|
|
127
127
|
*/
|
|
128
|
-
export function setIsolateScope(
|
|
129
|
-
element: Element,
|
|
130
|
-
scope: import("../core/scope/scope.js").Scope,
|
|
131
|
-
): void;
|
|
128
|
+
export function setIsolateScope(element: Element, scope: ng.Scope): void;
|
|
132
129
|
/**
|
|
133
130
|
* Gets the controller instance for a given element, if exists. Defaults to "ngControllerController"
|
|
134
131
|
*
|
|
135
132
|
* @param {Element} element - The DOM element to get data from.
|
|
136
133
|
* @param {string} [name] - Controller name.
|
|
137
|
-
* @returns {
|
|
134
|
+
* @returns {ng.Scope|undefined} - The retrieved data
|
|
138
135
|
*/
|
|
139
136
|
export function getController(
|
|
140
137
|
element: Element,
|
|
141
138
|
name?: string,
|
|
142
|
-
):
|
|
139
|
+
): ng.Scope | undefined;
|
|
143
140
|
/**
|
|
144
141
|
*
|
|
145
142
|
* @param {Node} element
|
|
@@ -152,13 +149,13 @@ export function getInheritedData(element: Node, name: string): any;
|
|
|
152
149
|
* @param {Node} element
|
|
153
150
|
* @param {string|string[]} name
|
|
154
151
|
* @param {any} [value]
|
|
155
|
-
* @returns
|
|
152
|
+
* @returns {any|undefined}
|
|
156
153
|
*/
|
|
157
154
|
export function setInheritedData(
|
|
158
155
|
element: Node,
|
|
159
156
|
name: string | string[],
|
|
160
157
|
value?: any,
|
|
161
|
-
): any;
|
|
158
|
+
): any | undefined;
|
|
162
159
|
/**
|
|
163
160
|
*
|
|
164
161
|
* @param {Element} element
|
package/@types/shared/hof.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export function curry(fn: any): any | (() => any | any);
|
|
|
46
46
|
* let composed = compose(f,g,h)
|
|
47
47
|
* then, composed is: f(g(h(x)))
|
|
48
48
|
*/
|
|
49
|
-
export function compose(...
|
|
49
|
+
export function compose(...fns: any[]): (...args: any[]) => any;
|
|
50
50
|
/**
|
|
51
51
|
* Given a class constructor, returns a predicate function that checks
|
|
52
52
|
* whether a given object is an instance of that class.
|
|
@@ -105,4 +105,4 @@ export function pattern(struct: any): (arg0: any) => any;
|
|
|
105
105
|
*/
|
|
106
106
|
export const propEq: any;
|
|
107
107
|
export function parse(path: any): (obj: any) => any;
|
|
108
|
-
export function val(
|
|
108
|
+
export function val(value: any): () => any;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Provides guarantees around presence and access.
|
|
4
4
|
*/
|
|
5
5
|
export class NodeRef {
|
|
6
|
+
static $nonscope: boolean;
|
|
6
7
|
/**
|
|
7
8
|
* @param {Node | Element | string | NodeList | Node[]} element - The DOM node(s) or HTML string to wrap.
|
|
8
9
|
* @throws {Error} If the argument is invalid or cannot be wrapped properly.
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Functions that manipulate strings
|
|
3
|
-
*/
|
|
4
1
|
/**
|
|
5
2
|
* Returns a string shortened to a maximum length
|
|
6
3
|
*
|
|
7
4
|
* If the string is already less than the `max` length, return the string.
|
|
8
5
|
* Else return the string, shortened to `max - 3` and append three dots ("...").
|
|
9
6
|
*
|
|
10
|
-
* @param max the maximum length of the string to return
|
|
11
|
-
* @param str the input string
|
|
7
|
+
* @param {number} max the maximum length of the string to return
|
|
8
|
+
* @param {string} str the input string
|
|
9
|
+
* @returns {string}
|
|
12
10
|
*/
|
|
13
|
-
export function maxLength(max:
|
|
11
|
+
export function maxLength(max: number, str: string): string;
|
|
14
12
|
/**
|
|
15
13
|
* Returns a string, with spaces added to the end, up to a desired str length
|
|
16
14
|
*
|
|
@@ -24,7 +22,7 @@ export function padString(length: any, str: any): any;
|
|
|
24
22
|
export function kebobString(camelCase: any): any;
|
|
25
23
|
export function functionToString(fn: any): any;
|
|
26
24
|
export function fnToString(fn: any): any;
|
|
27
|
-
export function stringify(
|
|
25
|
+
export function stringify(value: any): any;
|
|
28
26
|
/**
|
|
29
27
|
* Splits on a delimiter, but returns the delimiters in the array
|
|
30
28
|
*
|
|
@@ -48,5 +46,5 @@ export function splitOnDelim(delim: any): (str: any) => any;
|
|
|
48
46
|
* arr.reduce(joinNeighborsR, []) // ["foobar", 1, "bazqux" ]
|
|
49
47
|
* ```
|
|
50
48
|
*/
|
|
51
|
-
export function joinNeighborsR(acc: any,
|
|
49
|
+
export function joinNeighborsR(acc: any, str: any): any;
|
|
52
50
|
export function stripLastPathElement(str: any): any;
|
package/@types/shared/utils.d.ts
CHANGED
|
@@ -57,13 +57,7 @@ export function isObject(value: any): boolean;
|
|
|
57
57
|
* @returns {boolean} True if `value` is an `Object` with a null prototype
|
|
58
58
|
*/
|
|
59
59
|
export function isBlankObject(value: any): boolean;
|
|
60
|
-
|
|
61
|
-
* Determines if a reference is a `String`.
|
|
62
|
-
*
|
|
63
|
-
* @param {*} value Reference to check.
|
|
64
|
-
* @returns {boolean} True if `value` is a `String`.
|
|
65
|
-
*/
|
|
66
|
-
export function isString(value: any): boolean;
|
|
60
|
+
export function isString(value: unknown): boolean;
|
|
67
61
|
/**
|
|
68
62
|
* Determines if a reference is a null.
|
|
69
63
|
*
|
|
@@ -78,6 +72,13 @@ export function isNull(value: any): boolean;
|
|
|
78
72
|
* @returns {boolean} True if `value` is null or undefined.
|
|
79
73
|
*/
|
|
80
74
|
export function isNullOrUndefined(obj: any): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Determines if a reference is not null or undefined.
|
|
77
|
+
*
|
|
78
|
+
* @param {*} obj Reference to check.
|
|
79
|
+
* @returns {boolean} True if `value` is null or undefined.
|
|
80
|
+
*/
|
|
81
|
+
export function notNullOrUndefined(obj: any): boolean;
|
|
81
82
|
/**
|
|
82
83
|
* Determines if a reference is a `Number`.
|
|
83
84
|
*
|
|
@@ -180,10 +181,30 @@ export function snakeCase(name: any, separator: any): any;
|
|
|
180
181
|
/**
|
|
181
182
|
* Set or clear the hashkey for an object.
|
|
182
183
|
* @param obj object
|
|
183
|
-
* @param
|
|
184
|
-
*/
|
|
185
|
-
export function setHashKey(obj: any,
|
|
186
|
-
|
|
184
|
+
* @param hashkey the hashkey (!truthy to delete the hashkey)
|
|
185
|
+
*/
|
|
186
|
+
export function setHashKey(obj: any, hashkey: any): void;
|
|
187
|
+
/**
|
|
188
|
+
* Deeply extends a destination object with one or more source objects.
|
|
189
|
+
* Safely handles Dates, RegExps, DOM nodes, arrays, and nested objects.
|
|
190
|
+
* Ignores the `__proto__` key to prevent prototype pollution.
|
|
191
|
+
*
|
|
192
|
+
* @param {Object<string, any>} dst - The destination object to extend.
|
|
193
|
+
* @param {Array<Object<string, any>>} objs - Array of source objects to copy properties from.
|
|
194
|
+
* @param {boolean} [deep=false] - Whether to perform a deep merge of nested objects.
|
|
195
|
+
* @returns {Object<string, any>} The extended destination object.
|
|
196
|
+
*/
|
|
197
|
+
export function baseExtend(
|
|
198
|
+
dst: {
|
|
199
|
+
[x: string]: any;
|
|
200
|
+
},
|
|
201
|
+
objs: Array<{
|
|
202
|
+
[x: string]: any;
|
|
203
|
+
}>,
|
|
204
|
+
deep?: boolean,
|
|
205
|
+
): {
|
|
206
|
+
[x: string]: any;
|
|
207
|
+
};
|
|
187
208
|
/**
|
|
188
209
|
* Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)
|
|
189
210
|
* to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so
|
|
@@ -227,7 +248,7 @@ export function includes(array: any, obj: any): boolean;
|
|
|
227
248
|
* @returns {number} - The index of the removed value, or -1 if the value was not found.
|
|
228
249
|
*/
|
|
229
250
|
export function arrayRemove<T>(array: Array<T>, value: T): number;
|
|
230
|
-
export function simpleCompare(
|
|
251
|
+
export function simpleCompare(val1: any, val2: any): boolean;
|
|
231
252
|
/**
|
|
232
253
|
* Determines if two objects or two values are equivalent. Supports value types, regular
|
|
233
254
|
* expressions, arrays and objects.
|
|
@@ -286,7 +307,6 @@ export function simpleCompare(a: any, b: any): boolean;
|
|
|
286
307
|
</example>
|
|
287
308
|
*/
|
|
288
309
|
export function equals(o1: any, o2: any): boolean;
|
|
289
|
-
export function csp(): any;
|
|
290
310
|
/**
|
|
291
311
|
* throw error if the name given is hasOwnProperty
|
|
292
312
|
* @param {string} name the name to test
|
|
@@ -373,9 +393,9 @@ export function toKeyValue(obj: any): string;
|
|
|
373
393
|
* Tries to decode the URI component without throwing an exception.
|
|
374
394
|
*
|
|
375
395
|
* @param {string} value potential URI component to check.
|
|
376
|
-
* @returns {string|
|
|
396
|
+
* @returns {string|undefined}
|
|
377
397
|
*/
|
|
378
|
-
export function tryDecodeURIComponent(value: string): string |
|
|
398
|
+
export function tryDecodeURIComponent(value: string): string | undefined;
|
|
379
399
|
/**
|
|
380
400
|
* We need our custom method because encodeURIComponent is too aggressive and doesn't follow
|
|
381
401
|
* http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
|
|
@@ -414,6 +434,31 @@ export function shallowCopy(src: any, dst: any): any;
|
|
|
414
434
|
* @param {string} errorMsg
|
|
415
435
|
*/
|
|
416
436
|
export function assert(argument: boolean, errorMsg?: string): void;
|
|
437
|
+
/**
|
|
438
|
+
* Validate a value using a predicate function.
|
|
439
|
+
* Throws if the predicate returns false.
|
|
440
|
+
*
|
|
441
|
+
* @param {ng.Validator} fn - Predicate validator function.
|
|
442
|
+
* @param {*} arg - The value to validate.
|
|
443
|
+
* @param {string} name - Parameter name (included in error message).
|
|
444
|
+
* @returns {*} The validated value.
|
|
445
|
+
* @throws {TypeError} If the value does not satisfy the validator.
|
|
446
|
+
*/
|
|
447
|
+
export function validate(fn: ng.Validator, arg: any, name: string): any;
|
|
448
|
+
/**
|
|
449
|
+
* @param {*} arg - The value to validate.
|
|
450
|
+
* @param {string} name - Parameter name (included in error message).
|
|
451
|
+
* @returns {*} The validated value.
|
|
452
|
+
* @throws {TypeError} If the value does not satisfy the validator.
|
|
453
|
+
*/
|
|
454
|
+
export function validateRequired(arg: any, name: string): any;
|
|
455
|
+
/**
|
|
456
|
+
* @param {*} arg - The value to validate.
|
|
457
|
+
* @param {string} name - Parameter name (included in error message).
|
|
458
|
+
* @returns {*} The validated value.
|
|
459
|
+
* @throws {TypeError} If the value does not satisfy the validator.
|
|
460
|
+
*/
|
|
461
|
+
export function validateArray(arg: any, name: string): any;
|
|
417
462
|
/**
|
|
418
463
|
* Throw error if the argument is falsy.
|
|
419
464
|
*/
|
|
@@ -429,12 +474,12 @@ export function assertArgFn(
|
|
|
429
474
|
*
|
|
430
475
|
* Omitted or undefined options will leave the corresponding configuration values unchanged.
|
|
431
476
|
*
|
|
432
|
-
* @param {
|
|
433
|
-
* @returns {
|
|
477
|
+
* @param {ng.ErrorHandlingConfig} [config]
|
|
478
|
+
* @returns {ng.ErrorHandlingConfig}
|
|
434
479
|
*/
|
|
435
480
|
export function errorHandlingConfig(
|
|
436
|
-
config?:
|
|
437
|
-
):
|
|
481
|
+
config?: ng.ErrorHandlingConfig,
|
|
482
|
+
): ng.ErrorHandlingConfig;
|
|
438
483
|
/**
|
|
439
484
|
* This object provides a utility for producing rich Error messages within
|
|
440
485
|
* AngularTS. It can be called as follows:
|
|
@@ -479,13 +524,13 @@ export function hashKey(obj: any): string;
|
|
|
479
524
|
* Merges two class name values into a single space-separated string.
|
|
480
525
|
* Accepts strings, arrays of strings, or null/undefined values.
|
|
481
526
|
*
|
|
482
|
-
* @param {string | string[] | null | undefined}
|
|
483
|
-
* @param {string | string[] | null | undefined}
|
|
527
|
+
* @param {string | string[] | null | undefined} firstClass - The first class name(s).
|
|
528
|
+
* @param {string | string[] | null | undefined} secondClass - The second class name(s).
|
|
484
529
|
* @returns {string} A single string containing all class names separated by spaces.
|
|
485
530
|
*/
|
|
486
531
|
export function mergeClasses(
|
|
487
|
-
|
|
488
|
-
|
|
532
|
+
firstClass: string | string[] | null | undefined,
|
|
533
|
+
secondClass: string | string[] | null | undefined,
|
|
489
534
|
): string;
|
|
490
535
|
/**
|
|
491
536
|
* Converts all accepted directives format into proper directive name.
|
|
@@ -538,10 +583,10 @@ export function callBackAfterFirst(fn: Function): Function;
|
|
|
538
583
|
/**
|
|
539
584
|
* Delays execution for a specified number of milliseconds.
|
|
540
585
|
*
|
|
541
|
-
* @param {number} [
|
|
586
|
+
* @param {number} [timeout=0] - The number of milliseconds to wait. Defaults to 0.
|
|
542
587
|
* @returns {Promise<void>} A promise that resolves after the delay.
|
|
543
588
|
*/
|
|
544
|
-
export function wait(
|
|
589
|
+
export function wait(timeout?: number): Promise<void>;
|
|
545
590
|
/**
|
|
546
591
|
* Checks if a given string starts with a specified substring.
|
|
547
592
|
*
|
|
@@ -582,4 +627,7 @@ export function instantiateWasm(
|
|
|
582
627
|
module: WebAssembly.Module;
|
|
583
628
|
}>;
|
|
584
629
|
export const isProxySymbol: unique symbol;
|
|
630
|
+
export const BADARG: "badarg";
|
|
631
|
+
export const BADARGKEY: "badarg: key";
|
|
632
|
+
export const BADARGVALUE: "badarg: value";
|
|
585
633
|
export const ngAttrPrefixes: string[];
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
The MIT License
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2010-2020 Google LLC. http://angularjs.org
|
|
4
|
+
Copyright (c) 2021-present Angular Wave contributors. https://angular-wave.github.io/angular.ts/
|
|
4
5
|
|
|
5
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
7
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ AngularTS adds:
|
|
|
16
16
|
- built-in enterprise-level router (`ui-router` ported as `ng-router`)
|
|
17
17
|
- built-in animations (`animate`)
|
|
18
18
|
- new directives, inspired by `HTMX`
|
|
19
|
+
- new injectables for REST resources, persistent stores, Web Workers and WASM modules
|
|
19
20
|
|
|
20
21
|
The result is a high-performance, buildless, progressive and battle-tested JS framework that stays as close to Web standards as possible.
|
|
21
22
|
If you write server-rendered web applications for desktop and mobile, and do not wish to leave the comfort of your tech-stack, this is your new secret weapon.
|
|
@@ -43,97 +44,9 @@ Initialize your app
|
|
|
43
44
|
<div ng-app ng-init="x='world'">Hello {{ x }}</div>
|
|
44
45
|
```
|
|
45
46
|
|
|
46
|
-
Or check out the updated [Angular seed](https://github.com/angular-
|
|
47
|
+
Or check out the updated [Angular seed](https://github.com/angular-wave/angular-seed), which can serve as a solid starting point
|
|
47
48
|
or a source of inspiration for new ideas.
|
|
48
49
|
|
|
49
|
-
New docs website is coming!
|
|
50
|
-
|
|
51
|
-
### Legacy docs
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
- Web site: https://angularjs.org
|
|
56
|
-
- Tutorial: https://docs.angularjs.org/tutorial
|
|
57
|
-
- API Docs: https://docs.angularjs.org/api
|
|
58
|
-
- Developer Guide: https://docs.angularjs.org/guide
|
|
59
|
-
- Contribution guidelines: [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
60
|
-
- Core Development: [DEVELOPERS.md](DEVELOPERS.md)
|
|
61
|
-
- Dashboard: https://dashboard.angularjs.org
|
|
62
|
-
|
|
63
50
|
## Documentation
|
|
64
51
|
|
|
65
|
-
Go to https://
|
|
66
|
-
|
|
67
|
-
## Contribute
|
|
68
|
-
|
|
69
|
-
We've set up a separate document for our
|
|
70
|
-
[contribution guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md).
|
|
71
|
-
|
|
72
|
-
## Develop
|
|
73
|
-
|
|
74
|
-
We've set up a separate document for
|
|
75
|
-
[developers](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md).
|
|
76
|
-
|
|
77
|
-
## What to use AngularTS for and when to use it
|
|
78
|
-
|
|
79
|
-
AngularTS is the next generation framework where each component is designed to work with every other
|
|
80
|
-
component in an interconnected way like a well-oiled machine. AngularTS is JavaScript MVC made easy
|
|
81
|
-
and done right. (Well it is not really MVC, read on, to understand what this means.)
|
|
82
|
-
|
|
83
|
-
#### MVC, no, MV\* done the right way!
|
|
84
|
-
|
|
85
|
-
[MVC](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller), short for
|
|
86
|
-
Model-View-Controller, is a design pattern, i.e. how the code should be organized and how the
|
|
87
|
-
different parts of an application separated for proper readability and debugging. Model is the data
|
|
88
|
-
and the database. View is the user interface and what the user sees. Controller is the main link
|
|
89
|
-
between Model and View. These are the three pillars of major programming frameworks present on the
|
|
90
|
-
market today. On the other hand AngularTS works on MV\*, short for Model-View-_Whatever_. The
|
|
91
|
-
_Whatever_ is AngularTS's way of telling that you may create any kind of linking between the Model
|
|
92
|
-
and the View here.
|
|
93
|
-
|
|
94
|
-
Unlike other frameworks in any programming language, where MVC, the three separate components, each
|
|
95
|
-
one has to be written and then connected by the programmer, AngularTS helps the programmer by asking
|
|
96
|
-
him/her to just create these and everything else will be taken care of by AngularTS.
|
|
97
|
-
|
|
98
|
-
#### Interconnection with HTML at the root level
|
|
99
|
-
|
|
100
|
-
AngularTS uses HTML to define the user's interface. AngularTS also enables the programmer to write
|
|
101
|
-
new HTML tags (AngularTS Directives) and increase the readability and understandability of the HTML
|
|
102
|
-
code. Directives are AngularTS’s way of bringing additional functionality to HTML. Directives
|
|
103
|
-
achieve this by enabling us to invent our own HTML elements. This also helps in making the code DRY
|
|
104
|
-
(Don't Repeat Yourself), which means once created, a new directive can be used anywhere within the
|
|
105
|
-
application.
|
|
106
|
-
|
|
107
|
-
HTML is also used to determine the wiring of the app. Special attributes in the HTML determine where
|
|
108
|
-
to load the app, which components or controllers to use for each element, etc. We specify "what"
|
|
109
|
-
gets loaded, but not "how". This declarative approach greatly simplifies app development in a sort
|
|
110
|
-
of WYSIWYG way. Rather than spending time on how the program flows and orchestrating the various
|
|
111
|
-
moving parts, we simply define what we want and AngularTS will take care of the dependencies.
|
|
112
|
-
|
|
113
|
-
#### Data Handling made simple
|
|
114
|
-
|
|
115
|
-
Data and Data Models in AngularTS are plain JavaScript objects and one can add and change properties
|
|
116
|
-
directly on it and loop over objects and arrays at will.
|
|
117
|
-
|
|
118
|
-
#### Two-way Data Binding
|
|
119
|
-
|
|
120
|
-
One of AngularTS's strongest features. Two-way Data Binding means that if something changes in the
|
|
121
|
-
Model, the change gets reflected in the View instantaneously, and the same happens the other way
|
|
122
|
-
around. This is also referred to as Reactive Programming, i.e. suppose `a = b + c` is being
|
|
123
|
-
programmed and after this, if the value of `b` and/or `c` is changed then the value of `a` will be
|
|
124
|
-
automatically updated to reflect the change. AngularTS uses its "scopes" as a glue between the Model
|
|
125
|
-
and View and makes these updates in one available for the other.
|
|
126
|
-
|
|
127
|
-
#### Less Written Code and Easily Maintainable Code
|
|
128
|
-
|
|
129
|
-
Everything in AngularTS is created to enable the programmer to end up writing less code that is
|
|
130
|
-
easily maintainable and readable by any other new person on the team. Believe it or not, one can
|
|
131
|
-
write a complete working two-way data binded application in less than 10 lines of code. Try and see
|
|
132
|
-
for yourself!
|
|
133
|
-
|
|
134
|
-
#### Testing Ready
|
|
135
|
-
|
|
136
|
-
AngularTS has Dependency Injection, i.e. it takes care of providing all the necessary dependencies
|
|
137
|
-
to its controllers and services whenever required. This helps in making the AngularTS code ready for
|
|
138
|
-
unit testing by making use of mock dependencies created and injected. This makes AngularTS more
|
|
139
|
-
modular and easily testable thus in turn helping a team create more robust applications.
|
|
52
|
+
Go to https://angular-wave.github.io/angular.ts/
|