@angular-wave/angular.ts 0.0.39 → 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 +2 -0
- package/README.md +1 -1
- package/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -1
- package/package.json +1 -1
- package/rollup.config.js +10 -5
- 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 +1 -1
- 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 +186 -31
- package/src/loader.js +49 -11
- package/src/public.js +2 -3
- 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/types/animations/shared.d.ts +1 -1
- package/types/core/exception-handler.d.ts +9 -42
- package/types/core/interpolate/interpolate.d.ts +1 -1
- package/types/core/q/q.d.ts +35 -1
- package/types/core/task-tracker-factory.d.ts +18 -11
- package/types/core/timeout/timeout.d.ts +10 -1
- package/types/directive/model/model.d.ts +28 -4
- package/types/index.d.ts +664 -79
- package/types/services/browser.d.ts +50 -20
- package/types/services/document.d.ts +13 -9
- package/types/services/log.d.ts +37 -34
- package/types/services/template-request.d.ts +1 -1
- package/types/shared/common.d.ts +0 -1
- package/types/shared/jqlite/jqlite.d.ts +6 -7
- package/types/shared/utils.d.ts +22 -22
- package/types-back/index.d.ts +1 -75
- /package/src/core/cache/{cache-factor.spec.js → cache-factory.spec.js} +0 -0
package/src/index.js
CHANGED
|
@@ -144,47 +144,89 @@ import { publishExternalAPI } from "./public";
|
|
|
144
144
|
*/
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
|
-
* @typedef {angular.
|
|
147
|
+
* @typedef {angular.DirectiveController} TController
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @typedef {angular.Controller | angular.Controller[] | { [key: string]: angular.Controller }} angular.DirectiveController
|
|
148
152
|
* @description Represents a directive controller, which can be:
|
|
149
153
|
* - A single instance of {@link angular.Controller}
|
|
150
154
|
* - An array of {@link angular.Controller}
|
|
151
|
-
* - An object where keys are string identifiers and values are {@link
|
|
155
|
+
* - An object where keys are string identifiers and values are {@link angular.Controller}
|
|
152
156
|
*/
|
|
153
157
|
|
|
154
158
|
/**
|
|
155
|
-
*
|
|
159
|
+
* @template [S=import('./core/scope/scope').Scope]
|
|
160
|
+
* @template {TScope} S - The type of the directive's scope.
|
|
156
161
|
*
|
|
157
|
-
* @template
|
|
158
|
-
* @template TElement - The type of the directive's element.
|
|
159
|
-
* @template TAttributes - The type of the directive's attributes.
|
|
160
|
-
* @template TController - The type of the directive's controller.
|
|
162
|
+
* @template [T=import('./shared/jqlite/jqlite').JQLite]
|
|
163
|
+
* @template {TElement} T - The type of the directive's element.
|
|
161
164
|
*
|
|
165
|
+
* @template [A=angular.Attributes]
|
|
166
|
+
* @template {TAttributes} A - The type of the directive's attributes.
|
|
167
|
+
*
|
|
168
|
+
* @template [C=angular.Controller]
|
|
169
|
+
* @template {TController} C - The type of the directive's controller.
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Compile function for an AngularJS directive.
|
|
174
|
+
*
|
|
175
|
+
* @template TScope
|
|
176
|
+
* @template TElement
|
|
177
|
+
* @template TAttributes
|
|
178
|
+
* @template TController
|
|
162
179
|
* @callback angular.DirectiveCompileFn
|
|
163
180
|
* @param {TElement} templateElement - The template element.
|
|
164
181
|
* @param {TAttributes} templateAttributes - The template attributes.
|
|
165
|
-
* @param {
|
|
182
|
+
* @param {angular.TranscludeFunction} transclude - @deprecated The transclude function. Note: The transclude function that is passed to the compile function is deprecated,
|
|
166
183
|
* as it e.g. does not know about the right outer scope. Please use the transclude function
|
|
167
184
|
* that is passed to the link function instead.
|
|
168
|
-
* @returns {void | angular.DirectiveLinkFn<
|
|
185
|
+
* @returns {void | angular.DirectiveLinkFn<S, T, A, C> | angular.DirectivePrePost<S, T, A, C>} Returns void, angular.DirectiveLinkFn, or angular.DirectivePrePost.
|
|
169
186
|
*/
|
|
170
187
|
|
|
171
188
|
/**
|
|
172
189
|
* Link function for an AngularJS directive.
|
|
173
190
|
*
|
|
174
|
-
* @template TScope
|
|
175
|
-
* @template TElement
|
|
176
|
-
* @template TAttributes
|
|
177
|
-
* @template TController
|
|
178
|
-
*
|
|
191
|
+
* @template TScope
|
|
192
|
+
* @template TElement
|
|
193
|
+
* @template TAttributes
|
|
194
|
+
* @template TController
|
|
179
195
|
* @callback angular.DirectiveLinkFn
|
|
180
|
-
* @param {TScope} scope
|
|
181
|
-
* @param {TElement} instanceElement
|
|
182
|
-
* @param {TAttributes} instanceAttributes
|
|
183
|
-
* @param {TController} [controller]
|
|
184
|
-
* @param {
|
|
196
|
+
* @param {TScope} scope
|
|
197
|
+
* @param {TElement} instanceElement
|
|
198
|
+
* @param {TAttributes} instanceAttributes
|
|
199
|
+
* @param {TController} [controller]
|
|
200
|
+
* @param {angular.TranscludeFunction} [transclude]
|
|
185
201
|
* @returns {void}
|
|
186
202
|
*/
|
|
187
203
|
|
|
204
|
+
/**
|
|
205
|
+
* @callback angular.CloneAttachFunction
|
|
206
|
+
* @param {JQLite} [clonedElement]
|
|
207
|
+
* @param {Scope} [scope] // Let's hint but not force cloneAttachFn's signature
|
|
208
|
+
* @returns {any}
|
|
209
|
+
*/
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* This corresponds to $transclude passed to controllers and to the transclude function passed to link functions.
|
|
213
|
+
* https://docs.angularjs.org/api/ng/service/$compile#-controller-
|
|
214
|
+
* http://teropa.info/blog/2015/06/09/transclusion.html
|
|
215
|
+
*
|
|
216
|
+
* @typedef {Object} angular.TranscludeFunction
|
|
217
|
+
* @property {function(TScope, angular.CloneAttachFunction, JQLite=, string=): JQLite} transcludeWithScope
|
|
218
|
+
* @property {function(angular.CloneAttachFunction=, JQLite=, string=): JQLite} transcludeWithoutScope
|
|
219
|
+
* @property {function(string): boolean} isSlotFilled - Returns true if the specified slot contains content (i.e., one or more DOM nodes)
|
|
220
|
+
*/
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* @typedef {function(TScope, angular.CloneAttachFunction, JQLite=, string=): JQLite} transcludeWithScope
|
|
224
|
+
*/
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @typedef {function(angular.CloneAttachFunction=, JQLite=, string=): JQLite} transcludeWithoutScope
|
|
228
|
+
*/
|
|
229
|
+
|
|
188
230
|
/**
|
|
189
231
|
* Represents the pre and post linking functions of a directive.
|
|
190
232
|
*
|
|
@@ -194,9 +236,9 @@ import { publishExternalAPI } from "./public";
|
|
|
194
236
|
* @template TController The type of controller associated with the directive.
|
|
195
237
|
*
|
|
196
238
|
* @typedef {Object} angular.DirectivePrePost
|
|
197
|
-
* @property {angular.DirectiveLinkFn<
|
|
239
|
+
* @property {angular.DirectiveLinkFn<S, T, A, C> | undefined} [pre]
|
|
198
240
|
* The pre-linking function of the directive.
|
|
199
|
-
* @property {angular.DirectiveLinkFn<
|
|
241
|
+
* @property {angular.DirectiveLinkFn<S, T, A, C> | undefined} [post]
|
|
200
242
|
* The post-linking function of the directive.
|
|
201
243
|
*/
|
|
202
244
|
|
|
@@ -208,8 +250,8 @@ import { publishExternalAPI } from "./public";
|
|
|
208
250
|
* @template TAttributes - The type of the directive's attributes.
|
|
209
251
|
* @template TController - The type of the directive's controller.
|
|
210
252
|
*
|
|
211
|
-
* @typedef {Object}
|
|
212
|
-
* @property {angular.DirectiveCompileFn<
|
|
253
|
+
* @typedef {Object} angular.Directive
|
|
254
|
+
* @property {angular.DirectiveCompileFn<S, T, A, C> | undefined} [compile]
|
|
213
255
|
* Compile function for the directive.
|
|
214
256
|
* @property {string | angular.Injectable<angular.ControllerConstructor> | undefined} [controller]
|
|
215
257
|
* Controller constructor or name.
|
|
@@ -217,7 +259,7 @@ import { publishExternalAPI } from "./public";
|
|
|
217
259
|
* Controller alias.
|
|
218
260
|
* @property {boolean | { [boundProperty: string]: string } | undefined} [bindToController]
|
|
219
261
|
* Bindings to controller.
|
|
220
|
-
* @property {angular.DirectiveLinkFn<
|
|
262
|
+
* @property {angular.DirectiveLinkFn<S, T, A, C> | angular.DirectivePrePost<S, T, A, C> | undefined} [link]
|
|
221
263
|
* Link function.
|
|
222
264
|
* @property {boolean | undefined} [multiElement]
|
|
223
265
|
* Multi-element directive flag.
|
|
@@ -249,9 +291,45 @@ import { publishExternalAPI } from "./public";
|
|
|
249
291
|
* @template TAttributes - The type of the directive's attributes.
|
|
250
292
|
* @template TController - The type of the directive's controller.
|
|
251
293
|
*
|
|
252
|
-
* @typedef {(...args: any[]) =>
|
|
294
|
+
* @typedef {(...args: any[]) => angular.Directive<S, T, A, C> | angular.DirectiveLinkFn<S, T, A, C>} angular.DirectiveFactory
|
|
253
295
|
*/
|
|
254
296
|
|
|
297
|
+
/**
|
|
298
|
+
* @typedef {Function} angular.FilterFunction
|
|
299
|
+
* @property {boolean|undefined} [$stateful] By default, filters are only run once the input value changes. By marking the filter as `$stateful`, the filter will be run on every `$digest` to update the output. **This is strongly discouraged.** See https://docs.angularjs.org/guide/filter#stateful-filters
|
|
300
|
+
*/
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* @typedef {Function} angular.FilterFactory
|
|
304
|
+
* @returns {angular.FilterFunction}
|
|
305
|
+
*/
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Interface for a service provider class.
|
|
309
|
+
* @typedef {Object} angular.ServiceProviderClass
|
|
310
|
+
* @property {Function} constructor - The constructor for the service provider.
|
|
311
|
+
* @param {...any} args - The arguments for the constructor.
|
|
312
|
+
* @returns {angular.ServiceProvider}
|
|
313
|
+
*/
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Interface for a service provider factory function.
|
|
317
|
+
* @typedef {Function} angular.ServiceProviderFactory
|
|
318
|
+
* @param {...any} args - The arguments for the factory function.
|
|
319
|
+
* @returns {angular.ServiceProvider}
|
|
320
|
+
*/
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Interface for a service provider.
|
|
324
|
+
* @typedef {Object} angular.ServiceProvider
|
|
325
|
+
* @property {*} $get - The $get property that represents a service instance or a factory function.
|
|
326
|
+
*/
|
|
327
|
+
|
|
328
|
+
/** @type {angular.ServiceProvider} */
|
|
329
|
+
export const ServiceProvider = {
|
|
330
|
+
$get: undefined,
|
|
331
|
+
};
|
|
332
|
+
|
|
255
333
|
/**
|
|
256
334
|
* @typedef {Object} angular.Module
|
|
257
335
|
* @description AngularJS module interface for registering components, services, providers, etc.
|
|
@@ -271,21 +349,21 @@ import { publishExternalAPI } from "./public";
|
|
|
271
349
|
* Register a controller with the $controller service.
|
|
272
350
|
* @property {function({ [name: string]: angular.Injectable<angular.ControllerConstructor>> }): angular.Module} controller
|
|
273
351
|
* Register multiple controllers.
|
|
274
|
-
* @property {function<
|
|
352
|
+
* @property {function<S, T, A, C>(string, angular.Injectable<angular.DirectiveFactory<S, T, A, C>>): angular.Module} directive
|
|
275
353
|
* Register a directive with the compiler.
|
|
276
|
-
* @property {function<
|
|
354
|
+
* @property {function<S, T, A, C>(Object.<string, angular.Injectable<angular.DirectiveFactory<S, T, A, C>>>): angular.Module} directive
|
|
277
355
|
* Register multiple directives.
|
|
278
356
|
* @property {function(string, angular.Injectable<Function>): angular.Module} factory
|
|
279
357
|
* Register a service factory with the $injector.
|
|
280
358
|
* @property {function(Object.<string, angular.Injectable<Function>>): angular.Module} factory
|
|
281
359
|
* Register multiple service factories.
|
|
282
|
-
* @property {function(string, angular.Injectable<FilterFactory>): angular.Module} filter
|
|
360
|
+
* @property {function(string, angular.Injectable<angular.FilterFactory>): angular.Module} filter
|
|
283
361
|
* Register a filter service.
|
|
284
|
-
* @property {function(Object.<string, angular.Injectable<FilterFactory>>): angular.Module} filter
|
|
362
|
+
* @property {function(Object.<string, angular.Injectable<angular.FilterFactory>>): angular.Module} filter
|
|
285
363
|
* Register multiple filter services.
|
|
286
|
-
* @property {function(string,
|
|
364
|
+
* @property {function(string, angular.ServiceProviderFactory): angular.Module} provider
|
|
287
365
|
* Register a provider service factory.
|
|
288
|
-
* @property {function(string,
|
|
366
|
+
* @property {function(string, angular.ServiceProviderClass): angular.Module} provider
|
|
289
367
|
* Register a provider service constructor.
|
|
290
368
|
* @property {function(string, any[]): angular.Module} provider
|
|
291
369
|
* Register a provider service with inline annotated constructor.
|
|
@@ -307,6 +385,83 @@ import { publishExternalAPI } from "./public";
|
|
|
307
385
|
* Array of module names that this module depends on.
|
|
308
386
|
*/
|
|
309
387
|
|
|
388
|
+
/**
|
|
389
|
+
* @typedef {Object} angular.FormController
|
|
390
|
+
* @property {boolean} $pristine - True if the form has not been modified.
|
|
391
|
+
* @property {boolean} $dirty - True if the form has been modified.
|
|
392
|
+
* @property {boolean} $valid - True if the form is valid.
|
|
393
|
+
* @property {boolean} $invalid - True if the form is invalid.
|
|
394
|
+
* @property {boolean} $submitted - True if the form has been submitted.
|
|
395
|
+
* @property {Object.<string, Array.<angular.NgModelController|angular.FormController>>} $error - An object containing arrays of controls with validation errors keyed by validation error keys.
|
|
396
|
+
* @property {string|undefined} [$name] - The name of the form.
|
|
397
|
+
* @property {Object.<string, Array.<angular.NgModelController|angular.FormController>>|undefined} [$pending] - An object containing arrays of controls that are pending validation, keyed by validation error keys.
|
|
398
|
+
* @property {function(angular.NgModelController|angular.FormController): void} $addControl - Adds a control to the form.
|
|
399
|
+
* @property {function(): ReadonlyArray.<angular.NgModelController|angular.FormController>} $getControls - Returns an array of all controls in the form.
|
|
400
|
+
* @property {function(angular.NgModelController|angular.FormController): void} $removeControl - Removes a control from the form.
|
|
401
|
+
* @property {function(string, boolean, angular.NgModelController|angular.FormController): void} $setValidity - Sets the validity of a control in the form.
|
|
402
|
+
* @property {function(): void} $setDirty - Marks the form as dirty.
|
|
403
|
+
* @property {function(): void} $setPristine - Marks the form as pristine.
|
|
404
|
+
* @property {function(): void} $commitViewValue - Commits the view value of all controls in the form.
|
|
405
|
+
* @property {function(): void} $rollbackViewValue - Rolls back the view value of all controls in the form.
|
|
406
|
+
* @property {function(): void} $setSubmitted - Marks the form as submitted.
|
|
407
|
+
* @property {function(): void} $setUntouched - Marks the form controls as untouched.
|
|
408
|
+
* @property {function(string): any} [name] - An indexer for additional properties.
|
|
409
|
+
*/
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* @typedef {Object} angular.NgModelController
|
|
413
|
+
* @property {function(): void} $render - Renders the view value.
|
|
414
|
+
* @property {function(string, boolean): void} $setValidity - Sets the validity state.
|
|
415
|
+
* @property {function(any, string=): void} $setViewValue - Sets the view value.
|
|
416
|
+
* @property {function(): void} $setPristine - Marks the control as pristine.
|
|
417
|
+
* @property {function(): void} $setDirty - Marks the control as dirty.
|
|
418
|
+
* @property {function(): void} $validate - Validates the control.
|
|
419
|
+
* @property {function(): void} $setTouched - Marks the control as touched.
|
|
420
|
+
* @property {function(): void} $setUntouched - Marks the control as untouched.
|
|
421
|
+
* @property {function(): void} $rollbackViewValue - Rolls back the view value.
|
|
422
|
+
* @property {function(): void} $commitViewValue - Commits the view value.
|
|
423
|
+
* @property {function(): void} $processModelValue - Processes the model value.
|
|
424
|
+
* @property {function(any): boolean} $isEmpty - Checks if the value is empty.
|
|
425
|
+
* @property {function(angular.NgModelOptions): void} $overrideModelOptions - Overrides model options.
|
|
426
|
+
* @property {*} $viewValue - The current view value.
|
|
427
|
+
* @property {*} $modelValue - The current model value.
|
|
428
|
+
* @property {Array.<function(any, any): boolean>} $parsers - Array of parsers.
|
|
429
|
+
* @property {Array.<function(any): any>} $formatters - Array of formatters.
|
|
430
|
+
* @property {Array.<function(): any>} $viewChangeListeners - Array of view change listeners.
|
|
431
|
+
* @property {Object.<string, boolean>} $error - Validation errors.
|
|
432
|
+
* @property {string|undefined} [$name] - The name of the control.
|
|
433
|
+
* @property {boolean} $touched - True if the control has been touched.
|
|
434
|
+
* @property {boolean} $untouched - True if the control has not been touched.
|
|
435
|
+
* @property {Object.<string, function(any, any): boolean>} $validators - Synchronous validators.
|
|
436
|
+
* @property {Object.<string, function(any, any): angular.Promise<any>>} $asyncValidators - Asynchronous validators.
|
|
437
|
+
* @property {Object.<string, boolean>|undefined} [$pending] - Pending validation.
|
|
438
|
+
* @property {boolean} $pristine - True if the control is pristine.
|
|
439
|
+
* @property {boolean} $dirty - True if the control is dirty.
|
|
440
|
+
* @property {boolean} $valid - True if the control is valid.
|
|
441
|
+
* @property {boolean} $invalid - True if the control is invalid.
|
|
442
|
+
*/
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* @typedef {Object} angular.NgModelOptions
|
|
446
|
+
* @property {string|undefined} [updateOn] - The event to update on.
|
|
447
|
+
* @property {number|Object.<string, number>|undefined} [debounce] - The debounce delay.
|
|
448
|
+
* @property {boolean|undefined} [allowInvalid] - Allows invalid models.
|
|
449
|
+
* @property {boolean|undefined} [getterSetter] - Indicates if getter/setter syntax is allowed.
|
|
450
|
+
* @property {string|undefined} [timezone] - The timezone.
|
|
451
|
+
* @property {string|undefined} [timeSecondsFormat] - The format for seconds in time and datetime-local inputs.
|
|
452
|
+
* @property {boolean|undefined} [timeStripZeroSeconds] - Indicates if zero seconds should be stripped.
|
|
453
|
+
*/
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* @typedef {Object.<string, function(any, any): boolean>} IModelValidators
|
|
457
|
+
* @property {function(any, any): boolean} [index] - Validator function for each index.
|
|
458
|
+
*/
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* @typedef {Object.<string, function(any, any): IPromise<any>>} IAsyncModelValidators
|
|
462
|
+
* @property {function(any, any): IPromise<any>} [index] - Async validator function for each index.
|
|
463
|
+
*/
|
|
464
|
+
|
|
310
465
|
/**
|
|
311
466
|
* @type {Angular}
|
|
312
467
|
*/
|
package/src/loader.js
CHANGED
|
@@ -23,10 +23,15 @@ import {
|
|
|
23
23
|
isValidObjectMaxDepth,
|
|
24
24
|
minErrConfig,
|
|
25
25
|
} from "./shared/utils";
|
|
26
|
-
import {
|
|
26
|
+
import { JQLite, startingTag } from "./shared/jqlite/jqlite";
|
|
27
27
|
import { createInjector } from "./injector";
|
|
28
28
|
import { CACHE } from "./core/cache/cache";
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* @type {string} `version` from `package.json`, injected by Rollup plugin
|
|
32
|
+
*/
|
|
33
|
+
export const VERSION = "[VI]{version}[/VI]";
|
|
34
|
+
|
|
30
35
|
const ngMinErr = minErr("ng");
|
|
31
36
|
|
|
32
37
|
/** @type {Object.<string, import('./index.js').angular.Module>} */
|
|
@@ -45,34 +50,67 @@ const moduleCache = {};
|
|
|
45
50
|
*/
|
|
46
51
|
export class Angular {
|
|
47
52
|
constructor() {
|
|
53
|
+
CACHE.clear(); // a ensure new instance of angular gets a clean cache
|
|
54
|
+
|
|
55
|
+
/** @type {Map<number, import("./core/cache/cache").ExpandoStore>} */
|
|
48
56
|
this.cache = CACHE;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
major: 0,
|
|
53
|
-
minor: 0,
|
|
54
|
-
dot: 0,
|
|
55
|
-
codeName: "",
|
|
56
|
-
};
|
|
57
|
+
|
|
58
|
+
/** @type {string} */
|
|
59
|
+
this.version = VERSION;
|
|
57
60
|
|
|
58
61
|
// Utility methods kept for backwards purposes
|
|
62
|
+
/** @type {bind} */
|
|
59
63
|
this.bind = bind;
|
|
64
|
+
|
|
65
|
+
/** @type {equals} */
|
|
60
66
|
this.equals = equals;
|
|
61
|
-
|
|
67
|
+
|
|
68
|
+
/** @type {import('./shared/jqlite/jqlite').JQLite} */
|
|
69
|
+
this.element = JQLite;
|
|
70
|
+
|
|
71
|
+
/** @type {extend} */
|
|
62
72
|
this.extend = extend;
|
|
73
|
+
|
|
74
|
+
/** @type {forEach} */
|
|
63
75
|
this.forEach = forEach;
|
|
76
|
+
|
|
77
|
+
/** @type {fromJson} */
|
|
64
78
|
this.fromJson = fromJson;
|
|
79
|
+
|
|
80
|
+
/** @type {toJson} */
|
|
65
81
|
this.toJson = toJson;
|
|
82
|
+
|
|
83
|
+
/** @type {identity} */
|
|
66
84
|
this.identity = identity;
|
|
85
|
+
|
|
86
|
+
/** @type {isDate} */
|
|
67
87
|
this.isDate = isDate;
|
|
88
|
+
|
|
89
|
+
/** @type {isDefined} */
|
|
68
90
|
this.isDefined = isDefined;
|
|
91
|
+
|
|
92
|
+
/** @type {isElement} */
|
|
69
93
|
this.isElement = isElement;
|
|
94
|
+
|
|
95
|
+
/** @type {isFunction} */
|
|
70
96
|
this.isFunction = isFunction;
|
|
97
|
+
|
|
98
|
+
/** @type {isNumber} */
|
|
71
99
|
this.isNumber = isNumber;
|
|
100
|
+
|
|
101
|
+
/** @type {isObject} */
|
|
72
102
|
this.isObject = isObject;
|
|
103
|
+
|
|
104
|
+
/** @type {isString} */
|
|
73
105
|
this.isString = isString;
|
|
106
|
+
|
|
107
|
+
/** @type {isUndefined} */
|
|
74
108
|
this.isUndefined = isUndefined;
|
|
109
|
+
|
|
110
|
+
/** @type {merge} */
|
|
75
111
|
this.merge = merge;
|
|
112
|
+
|
|
113
|
+
/** @type {errorHandlingConfig} */
|
|
76
114
|
this.errorHandlingConfig = errorHandlingConfig;
|
|
77
115
|
}
|
|
78
116
|
|
|
@@ -143,7 +181,7 @@ export class Angular {
|
|
|
143
181
|
};
|
|
144
182
|
this.doBootstrap = function () {
|
|
145
183
|
// @ts-ignore
|
|
146
|
-
element =
|
|
184
|
+
element = JQLite(element);
|
|
147
185
|
|
|
148
186
|
if (element.injector()) {
|
|
149
187
|
const tag =
|
package/src/public.js
CHANGED
|
@@ -103,6 +103,7 @@ import { initAnimateModule } from "./animations/module";
|
|
|
103
103
|
import { initMessageModule } from "./exts/messages/messages";
|
|
104
104
|
import { initAriaModule } from "./exts/aria/aria";
|
|
105
105
|
import { initRouter } from "./router/index";
|
|
106
|
+
import { VERSION } from "./loader";
|
|
106
107
|
|
|
107
108
|
/**
|
|
108
109
|
* Initializes `ng`, `animate`, `message`, `aria` and `router` modules.
|
|
@@ -211,9 +212,7 @@ export function publishExternalAPI() {
|
|
|
211
212
|
});
|
|
212
213
|
},
|
|
213
214
|
],
|
|
214
|
-
)
|
|
215
|
-
// Gets injected by rollup plugin
|
|
216
|
-
.info({ angularVersion: "[VI]{version}[/VI]" });
|
|
215
|
+
).info({ angularVersion: VERSION });
|
|
217
216
|
|
|
218
217
|
initAnimateModule();
|
|
219
218
|
initMessageModule();
|