@angular-wave/angular.ts 0.0.62 → 0.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/package.json +1 -1
- package/src/angular.spec.js +0 -9
- package/src/animations/animate-css-driver.js +1 -1
- package/src/animations/animate-queue.js +9 -0
- package/src/core/compile/compile.js +0 -33
- package/src/core/compile/compile.spec.js +0 -47
- package/src/core/location/location.js +7 -0
- package/src/directive/init/init.spec.js +2 -2
- package/src/injector.js +7 -0
- package/src/loader.js +99 -660
- package/src/shared/jqlite/jqlite.js +20 -29
- package/src/shared/jqlite/jqlite.md +62 -0
- package/src/shared/min-err.spec.js +1 -2
- package/src/shared/utils.js +36 -2
- package/src/types.js +3 -4
- package/types/animations/animate-css-driver.d.ts +2 -1
- package/types/animations/animate-queue.d.ts +2 -1
- package/types/core/compile/compile.d.ts +0 -1
- package/types/core/location/location.d.ts +2 -1
- package/types/injector.d.ts +7 -7
- package/types/loader.d.ts +64 -136
- package/types/shared/jqlite/jqlite.d.ts +5 -5
- package/types/shared/utils.d.ts +20 -1
- package/types/types.d.ts +3 -3
|
@@ -16,11 +16,6 @@ import {
|
|
|
16
16
|
import { CACHE, EXPANDO } from "../../core/cache/cache";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* @name angular.element
|
|
20
|
-
* @module ng
|
|
21
|
-
* @kind function
|
|
22
|
-
*
|
|
23
|
-
* @description
|
|
24
19
|
* Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element. Regardless of the presence of jQuery, `angular.element`
|
|
25
20
|
* delegates to AngularJS's built-in subset of jQuery, called "jQuery lite" or **jqLite**.
|
|
26
21
|
*
|
|
@@ -80,12 +75,6 @@ import { CACHE, EXPANDO } from "../../core/cache/cache";
|
|
|
80
75
|
* Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled.
|
|
81
76
|
* - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top
|
|
82
77
|
* parent element is reached.
|
|
83
|
-
*
|
|
84
|
-
* @knownIssue You cannot spy on `angular.element` if you are using Jasmine version 1.x. See
|
|
85
|
-
* https://github.com/angular/angular.js/issues/14251 for more information.
|
|
86
|
-
*
|
|
87
|
-
* @param {string|Element} element HTML string or Element to be wrapped into jQuery.
|
|
88
|
-
* @returns {JQLite} jQuery object.
|
|
89
78
|
*/
|
|
90
79
|
|
|
91
80
|
/** @type {number} */
|
|
@@ -135,7 +124,7 @@ const BOOLEAN_ELEMENTS = {};
|
|
|
135
124
|
* JQLite both a function and an array-like data structure for manipulation of DOM, linking elements to expando cache,
|
|
136
125
|
* and execution of chain functions.
|
|
137
126
|
*
|
|
138
|
-
* @param {string|
|
|
127
|
+
* @param {string|Node|JQLite|ArrayLike<Element>|(() => void)} element
|
|
139
128
|
* @returns {JQLite}
|
|
140
129
|
*/
|
|
141
130
|
export function JQLite(element) {
|
|
@@ -553,15 +542,7 @@ JQLite.prototype.replaceWith = function (arg1) {
|
|
|
553
542
|
});
|
|
554
543
|
};
|
|
555
544
|
for (let i = 0; i < this.length; i++) {
|
|
556
|
-
|
|
557
|
-
value = fn(this[i], arg1);
|
|
558
|
-
if (isDefined(value)) {
|
|
559
|
-
// any function which returns a value needs to be wrapped
|
|
560
|
-
value = JQLite(value);
|
|
561
|
-
}
|
|
562
|
-
} else {
|
|
563
|
-
addNodes(value, fn(this[i], arg1));
|
|
564
|
-
}
|
|
545
|
+
addNodes(value, fn(this[i], arg1));
|
|
565
546
|
}
|
|
566
547
|
return isDefined(value) ? value : this;
|
|
567
548
|
};
|
|
@@ -893,6 +874,7 @@ function elementAcceptsData(node) {
|
|
|
893
874
|
* @returns {DocumentFragment}
|
|
894
875
|
*/
|
|
895
876
|
export function buildFragment(html) {
|
|
877
|
+
/** @type {HTMLDivElement} */
|
|
896
878
|
let tmp;
|
|
897
879
|
let tag;
|
|
898
880
|
let wrap;
|
|
@@ -905,6 +887,7 @@ export function buildFragment(html) {
|
|
|
905
887
|
nodes.push(document.createTextNode(html));
|
|
906
888
|
} else {
|
|
907
889
|
// Convert html into DOM nodes
|
|
890
|
+
|
|
908
891
|
tmp = tempFragment.appendChild(document.createElement("div"));
|
|
909
892
|
tag = (TAG_NAME_REGEXP.exec(html) || ["", ""])[1].toLowerCase();
|
|
910
893
|
|
|
@@ -914,13 +897,13 @@ export function buildFragment(html) {
|
|
|
914
897
|
i = wrap.length;
|
|
915
898
|
while (--i > -1) {
|
|
916
899
|
tmp.appendChild(window.document.createElement(wrap[i]));
|
|
917
|
-
tmp = tmp.firstChild;
|
|
900
|
+
tmp = /** @type {HTMLDivElement} */ (tmp.firstChild);
|
|
918
901
|
}
|
|
919
902
|
tmp.innerHTML = html;
|
|
920
903
|
|
|
921
904
|
nodes = concat(nodes, tmp.childNodes);
|
|
922
905
|
|
|
923
|
-
tmp = tempFragment.firstChild;
|
|
906
|
+
tmp = /** @type {HTMLDivElement} */ (tempFragment.firstChild);
|
|
924
907
|
tmp.textContent = "";
|
|
925
908
|
}
|
|
926
909
|
|
|
@@ -1021,7 +1004,7 @@ export function getOrSetCacheData(element, key, value) {
|
|
|
1021
1004
|
/**
|
|
1022
1005
|
* Adds nodes or elements to the root array-like object.
|
|
1023
1006
|
*
|
|
1024
|
-
* @param {
|
|
1007
|
+
* @param {JQLite} root - The array-like object to which elements will be added.
|
|
1025
1008
|
* @param {(Node|Array|NodeList|Object)} elements - The elements to add to the root. This can be a single DOM node, an array-like object (such as an Array or NodeList), or any other object.
|
|
1026
1009
|
*/
|
|
1027
1010
|
function addNodes(root, elements) {
|
|
@@ -1054,7 +1037,7 @@ function getController(element, name) {
|
|
|
1054
1037
|
|
|
1055
1038
|
/**
|
|
1056
1039
|
*
|
|
1057
|
-
* @param {
|
|
1040
|
+
* @param {Node} element
|
|
1058
1041
|
* @param {string|string[]} name
|
|
1059
1042
|
* @param {any} [value]
|
|
1060
1043
|
* @returns
|
|
@@ -1064,13 +1047,20 @@ function getInheritedData(element, name, value) {
|
|
|
1064
1047
|
// this makes $(document).scope() possible
|
|
1065
1048
|
if (element.nodeType === Node.DOCUMENT_NODE) {
|
|
1066
1049
|
// TODO Fix types
|
|
1067
|
-
element = element.documentElement;
|
|
1050
|
+
element = /** @type {Document} */ (element).documentElement;
|
|
1068
1051
|
}
|
|
1069
1052
|
const names = Array.isArray(name) ? name : [name];
|
|
1070
1053
|
|
|
1071
1054
|
while (element) {
|
|
1072
1055
|
for (let i = 0, ii = names.length; i < ii; i++) {
|
|
1073
|
-
if (
|
|
1056
|
+
if (
|
|
1057
|
+
isDefined(
|
|
1058
|
+
(value = getOrSetCacheData(
|
|
1059
|
+
/** @type {Element} */ (element),
|
|
1060
|
+
names[i],
|
|
1061
|
+
)),
|
|
1062
|
+
)
|
|
1063
|
+
)
|
|
1074
1064
|
return value;
|
|
1075
1065
|
}
|
|
1076
1066
|
|
|
@@ -1079,7 +1069,8 @@ function getInheritedData(element, name, value) {
|
|
|
1079
1069
|
// to lookup parent controllers.
|
|
1080
1070
|
element =
|
|
1081
1071
|
element.parentNode ||
|
|
1082
|
-
(element.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&
|
|
1072
|
+
(element.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&
|
|
1073
|
+
/** @type {ShadowRoot} */ (element).host);
|
|
1083
1074
|
}
|
|
1084
1075
|
}
|
|
1085
1076
|
|
|
@@ -1193,7 +1184,7 @@ function specialMouseHandlerWrapper(target, event, handler) {
|
|
|
1193
1184
|
export function startingTag(elementStr) {
|
|
1194
1185
|
const clone = JQLite(elementStr)[0].cloneNode(true);
|
|
1195
1186
|
const element = JQLite(clone).empty();
|
|
1196
|
-
var elemHtml = JQLite("<div></div>").append(element).html();
|
|
1187
|
+
var elemHtml = JQLite("<div></div>").append(element[0]).html();
|
|
1197
1188
|
try {
|
|
1198
1189
|
return element[0].nodeType === Node.TEXT_NODE
|
|
1199
1190
|
? lowercase(elemHtml)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/\*\*
|
|
2
|
+
|
|
3
|
+
- Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element. Regardless of the presence of jQuery, `angular.element`
|
|
4
|
+
- delegates to AngularJS's built-in subset of jQuery, called "jQuery lite" or **jqLite**.
|
|
5
|
+
-
|
|
6
|
+
- JQLite is a tiny, API-compatible subset of jQuery that allows
|
|
7
|
+
- AngularJS to manipulate the DOM in a cross-browser compatible way. JQLite implements only the most
|
|
8
|
+
- commonly needed functionality with the goal of having a very small footprint.
|
|
9
|
+
-
|
|
10
|
+
- <div class="alert alert-info">**Note:** All element references in AngularJS are always wrapped with
|
|
11
|
+
- JQLite (such as the element argument in a directive's compile / link function). They are never raw DOM references.</div>
|
|
12
|
+
-
|
|
13
|
+
- <div class="alert alert-warning">**Note:** Keep in mind that this function will not find elements
|
|
14
|
+
- by tag name / CSS selector. For lookups by tag name, try instead `angular.element(document).find(...)`
|
|
15
|
+
- or `$document.find()`, or use the standard DOM APIs, e.g. `document.querySelectorAll()`.</div>
|
|
16
|
+
-
|
|
17
|
+
- ## AngularJS's JQLite
|
|
18
|
+
- JQLite provides only the following jQuery methods:
|
|
19
|
+
-
|
|
20
|
+
- - [`after()`](http://api.jquery.com/after/)
|
|
21
|
+
- - [`append()`](http://api.jquery.com/append/) - Contrary to jQuery, this doesn't clone elements
|
|
22
|
+
- so will not work correctly when invoked on a JQLite object containing more than one DOM node
|
|
23
|
+
- - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters
|
|
24
|
+
- - [`children()`](http://api.jquery.com/children/) - Does not support selectors
|
|
25
|
+
- - [`data()`](http://api.jquery.com/data/)
|
|
26
|
+
- - [`empty()`](http://api.jquery.com/empty/)
|
|
27
|
+
- - [`eq()`](http://api.jquery.com/eq/)
|
|
28
|
+
- - [`html()`](http://api.jquery.com/html/)
|
|
29
|
+
- - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData
|
|
30
|
+
- - [`off()`](http://api.jquery.com/off/) - Does not support namespaces, selectors or event object as parameter
|
|
31
|
+
- - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors
|
|
32
|
+
- - [`prepend()`](http://api.jquery.com/prepend/)
|
|
33
|
+
- - [`remove()`](http://api.jquery.com/remove/)
|
|
34
|
+
- - [`removeData()`](http://api.jquery.com/removeData/)
|
|
35
|
+
- - [`replaceWith()`](http://api.jquery.com/replaceWith/)
|
|
36
|
+
- - [`text()`](http://api.jquery.com/text/)
|
|
37
|
+
- - [`val()`](http://api.jquery.com/val/)
|
|
38
|
+
-
|
|
39
|
+
- ## jQuery/jqLite Extras
|
|
40
|
+
- AngularJS also provides the following additional methods and events to both jQuery and JQLite:
|
|
41
|
+
-
|
|
42
|
+
- ### Events
|
|
43
|
+
- - `$destroy` - AngularJS intercepts all JQLite/jQuery's DOM destruction apis and fires this event
|
|
44
|
+
- on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM
|
|
45
|
+
- element before it is removed.
|
|
46
|
+
-
|
|
47
|
+
- ### Methods
|
|
48
|
+
- - `controller(name)` - retrieves the controller of the current element or its parent. By default
|
|
49
|
+
- retrieves controller associated with the `ngController` directive. If `name` is provided as
|
|
50
|
+
- camelCase directive name, then the controller for this directive will be retrieved (e.g.
|
|
51
|
+
- `'ngModel'`).
|
|
52
|
+
- - `injector()` - retrieves the injector of the current element or its parent.
|
|
53
|
+
- - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current
|
|
54
|
+
- element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to
|
|
55
|
+
- be enabled.
|
|
56
|
+
- - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the
|
|
57
|
+
- current element. This getter should be used only on elements that contain a directive which starts a new isolate
|
|
58
|
+
- scope. Calling `scope()` on this element always returns the original non-isolate scope.
|
|
59
|
+
- Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled.
|
|
60
|
+
- - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top
|
|
61
|
+
- parent element is reached.
|
|
62
|
+
\*/
|
package/src/shared/utils.js
CHANGED
|
@@ -1101,7 +1101,41 @@ export function assertArgFn(arg, name, acceptArrayAnnotation) {
|
|
|
1101
1101
|
return arg;
|
|
1102
1102
|
}
|
|
1103
1103
|
|
|
1104
|
-
|
|
1104
|
+
/**
|
|
1105
|
+
* @typedef {Object} ErrorHandlingConfig
|
|
1106
|
+
* Error configuration object. May only contain the options that need to be updated.
|
|
1107
|
+
* @property {number=} objectMaxDepth - The max depth for stringifying objects. Setting to a
|
|
1108
|
+
* non-positive or non-numeric value removes the max depth limit. Default: 5.
|
|
1109
|
+
* @property {boolean=} urlErrorParamsEnabled - Specifies whether the generated error URL will
|
|
1110
|
+
* contain the parameters of the thrown error. Default: true. When used without argument, it returns the current value.
|
|
1111
|
+
*/
|
|
1112
|
+
|
|
1113
|
+
/** @type {ErrorHandlingConfig} */
|
|
1114
|
+
const minErrConfig = {
|
|
1115
|
+
objectMaxDepth: 5,
|
|
1116
|
+
urlErrorParamsEnabled: true,
|
|
1117
|
+
};
|
|
1118
|
+
|
|
1119
|
+
/**
|
|
1120
|
+
* @param {ErrorHandlingConfig} [config]
|
|
1121
|
+
* @returns {ErrorHandlingConfig}
|
|
1122
|
+
*/
|
|
1123
|
+
export function errorHandlingConfig(config) {
|
|
1124
|
+
if (isObject(config)) {
|
|
1125
|
+
if (isDefined(config.objectMaxDepth)) {
|
|
1126
|
+
minErrConfig.objectMaxDepth = isValidObjectMaxDepth(config.objectMaxDepth)
|
|
1127
|
+
? config.objectMaxDepth
|
|
1128
|
+
: NaN;
|
|
1129
|
+
}
|
|
1130
|
+
if (
|
|
1131
|
+
isDefined(config.urlErrorParamsEnabled) &&
|
|
1132
|
+
isBoolean(config.urlErrorParamsEnabled)
|
|
1133
|
+
) {
|
|
1134
|
+
minErrConfig.urlErrorParamsEnabled = config.urlErrorParamsEnabled;
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
return minErrConfig;
|
|
1138
|
+
}
|
|
1105
1139
|
|
|
1106
1140
|
/**
|
|
1107
1141
|
* This object provides a utility for producing rich Error messages within
|
|
@@ -1158,7 +1192,7 @@ export function minErr(module) {
|
|
|
1158
1192
|
|
|
1159
1193
|
message += `\n${url}${module ? `${module}/` : ""}${code}`;
|
|
1160
1194
|
|
|
1161
|
-
if (
|
|
1195
|
+
if (errorHandlingConfig().urlErrorParamsEnabled) {
|
|
1162
1196
|
for (
|
|
1163
1197
|
i = 0, paramPrefix = "?";
|
|
1164
1198
|
i < templateArgs.length;
|
package/src/types.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {Object} BootstrapConfig
|
|
3
3
|
* @description Configuration option for AngularTS bootstrap process.
|
|
4
|
-
* @property {boolean} debugInfoEnabled - Indicates whether debug information should be enabled. Setting this to `false` can improve performance but will disable some debugging features.
|
|
5
4
|
* @property {boolean} [strictDi] - Disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. Defaults to `false`.
|
|
6
5
|
*/
|
|
7
6
|
|
|
@@ -451,9 +450,9 @@
|
|
|
451
450
|
* @property {function(string, string=): any} get - Get a service by name.
|
|
452
451
|
* @property {function(Function, any?): any} instantiate - Instantiate a type constructor with optional locals.
|
|
453
452
|
* @property {function(Injectable<Function | ((...args: any[]) => any)>, any=, any=): any} invoke - Invoke a function with optional context and locals.
|
|
454
|
-
* @property {function(Array<Module | string | Injectable<(...args: any[]) => void>>): void} loadNewModules - Add and load new modules to the injector.
|
|
455
|
-
* @property {Object.<string, Module>} modules - A map of all the modules loaded into the injector.
|
|
456
|
-
* @property {boolean} strictDi - Indicates if strict dependency injection is enforced.
|
|
453
|
+
* @property {function(Array<Module | string | Injectable<(...args: any[]) => void>>): void} [loadNewModules] - Add and load new modules to the injector.
|
|
454
|
+
* @property {Object.<string, Module>} [modules] - A map of all the modules loaded into the injector.
|
|
455
|
+
* @property {boolean} [strictDi] - Indicates if strict dependency injection is enforced.
|
|
457
456
|
*/
|
|
458
457
|
|
|
459
458
|
export {};
|
|
@@ -4,8 +4,9 @@ export class $$AnimateCssDriverProvider {
|
|
|
4
4
|
/**
|
|
5
5
|
* @returns {Function}
|
|
6
6
|
*/
|
|
7
|
-
$get: (string | (($animateCss: any, $$AnimateRunner: typeof import("../core/animate/animate-runner").AnimateRunner, $rootElement:
|
|
7
|
+
$get: (string | (($animateCss: any, $$AnimateRunner: typeof import("../core/animate/animate-runner").AnimateRunner, $rootElement: JQLite) => (animationDetails: any) => any))[];
|
|
8
8
|
}
|
|
9
9
|
export namespace $$AnimateCssDriverProvider {
|
|
10
10
|
let $inject: string[];
|
|
11
11
|
}
|
|
12
|
+
import { JQLite } from "../shared/jqlite/jqlite";
|
|
@@ -6,7 +6,7 @@ export class $$AnimateQueueProvider {
|
|
|
6
6
|
cancel: any[];
|
|
7
7
|
join: any[];
|
|
8
8
|
};
|
|
9
|
-
$get: (string | (($rootScope: any, $rootElement:
|
|
9
|
+
$get: (string | (($rootScope: any, $rootElement: JQLite, $$animation: any, $$AnimateRunner: any, $templateRequest: any) => {
|
|
10
10
|
on(event: any, container: any, callback: any): void;
|
|
11
11
|
off(event: any, container: any, callback: any, ...args: any[]): void;
|
|
12
12
|
pin(element: any, parentElement: any): void;
|
|
@@ -17,3 +17,4 @@ export class $$AnimateQueueProvider {
|
|
|
17
17
|
export namespace $$AnimateQueueProvider {
|
|
18
18
|
let $inject: string[];
|
|
19
19
|
}
|
|
20
|
+
import { JQLite } from "../shared/jqlite/jqlite";
|
|
@@ -147,7 +147,6 @@ export class $CompileProvider {
|
|
|
147
147
|
* chaining otherwise.
|
|
148
148
|
*/
|
|
149
149
|
imgSrcSanitizationTrustedUrlList: (regexp?: RegExp | undefined) => RegExp | ng.ICompileProvider;
|
|
150
|
-
debugInfoEnabled: (enabled: any) => boolean | this;
|
|
151
150
|
strictComponentBindingsEnabled: (enabled: any) => boolean | this;
|
|
152
151
|
/**
|
|
153
152
|
* @ngdoc method
|
|
@@ -204,6 +204,7 @@ export class $LocationProvider {
|
|
|
204
204
|
* @param {string=} newState New history state object
|
|
205
205
|
* @param {string=} oldState History state object that was before it was changed.
|
|
206
206
|
*/
|
|
207
|
-
$get: (string | (($rootScope: any, $browser: any, $rootElement:
|
|
207
|
+
$get: (string | (($rootScope: any, $browser: any, $rootElement: JQLite) => LocationHtml5Url | LocationHashbangUrl))[];
|
|
208
208
|
}
|
|
209
209
|
export const PATH_MATCH: RegExp;
|
|
210
|
+
import { JQLite } from "../../shared/jqlite/jqlite";
|
package/types/injector.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {*} modulesToLoad
|
|
4
|
+
* @param {*} strictDi
|
|
5
|
+
* @returns {import("./types").InjectorService}
|
|
6
|
+
*/
|
|
7
|
+
export function createInjector(modulesToLoad: any, strictDi: any): import("./types").InjectorService;
|
|
8
8
|
export namespace createInjector {
|
|
9
9
|
export { annotate as $$annotate };
|
|
10
10
|
}
|
package/types/loader.d.ts
CHANGED
|
@@ -139,7 +139,10 @@
|
|
|
139
139
|
</file>
|
|
140
140
|
</example>
|
|
141
141
|
*/
|
|
142
|
-
|
|
142
|
+
/**
|
|
143
|
+
* @param {Element|Document} element
|
|
144
|
+
*/
|
|
145
|
+
export function angularInit(element: Element | Document): void;
|
|
143
146
|
/**
|
|
144
147
|
* @ngdoc type
|
|
145
148
|
* @name import('./types').Module
|
|
@@ -149,34 +152,6 @@ export function angularInit(element: any): void;
|
|
|
149
152
|
* Interface for configuring AngularJS {@link angular.module modules}.
|
|
150
153
|
*/
|
|
151
154
|
export function setupModuleLoader(window: any): any;
|
|
152
|
-
/**
|
|
153
|
-
* @ngdoc function
|
|
154
|
-
* @name angular.errorHandlingConfig
|
|
155
|
-
* @module ng
|
|
156
|
-
* @kind function
|
|
157
|
-
*
|
|
158
|
-
* @description
|
|
159
|
-
* Configure several aspects of error handling in AngularJS if used as a setter or return the
|
|
160
|
-
* current configuration if used as a getter. The following options are supported:
|
|
161
|
-
*
|
|
162
|
-
* - **objectMaxDepth**: The maximum depth to which objects are traversed when stringified for error messages.
|
|
163
|
-
*
|
|
164
|
-
* Omitted or undefined options will leave the corresponding configuration values unchanged.
|
|
165
|
-
*
|
|
166
|
-
* @param {Object=} config - The configuration object. May only contain the options that need to be
|
|
167
|
-
* updated. Supported keys:
|
|
168
|
-
*
|
|
169
|
-
* * `objectMaxDepth` **{Number}** - The max depth for stringifying objects. Setting to a
|
|
170
|
-
* non-positive or non-numeric value, removes the max depth limit.
|
|
171
|
-
* Default: 5
|
|
172
|
-
*
|
|
173
|
-
* * `urlErrorParamsEnabled` **{Boolean}** - Specifies whether the generated error url will
|
|
174
|
-
* contain the parameters of the thrown error. Disabling the parameters can be useful if the
|
|
175
|
-
* generated error url is very long.
|
|
176
|
-
*
|
|
177
|
-
* Default: true. When used without argument, it returns the current value.
|
|
178
|
-
*/
|
|
179
|
-
export function errorHandlingConfig(config?: any | undefined): {};
|
|
180
155
|
/**
|
|
181
156
|
* @type {string} `version` from `package.json`, injected by Rollup plugin
|
|
182
157
|
*/
|
|
@@ -185,7 +160,6 @@ export const VERSION: string;
|
|
|
185
160
|
* Configuration option for AngularTS bootstrap process.
|
|
186
161
|
*
|
|
187
162
|
* @typedef {Object} AngularBootstrapConfig
|
|
188
|
-
* @property {boolean} debugInfoEnabled - Indicates whether debug information should be enabled. Setting this to `false` can improve performance but will disable some debugging features.
|
|
189
163
|
* @property {boolean} [strictDi] - Disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. Defaults to `false`.
|
|
190
164
|
*/
|
|
191
165
|
/**
|
|
@@ -198,126 +172,84 @@ export class Angular {
|
|
|
198
172
|
version: string;
|
|
199
173
|
/** @type {typeof import('./shared/jqlite/jqlite').JQLite} */
|
|
200
174
|
element: typeof import("./shared/jqlite/jqlite").JQLite;
|
|
201
|
-
/** @type {
|
|
202
|
-
|
|
175
|
+
/** @type {!Array<string|any>} */
|
|
176
|
+
bootsrappedModules: Array<string | any>;
|
|
203
177
|
/** @type {Function} */
|
|
204
178
|
doBootstrap: Function;
|
|
205
179
|
/**
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
* @description
|
|
210
|
-
* Use this function to manually start up AngularJS application.
|
|
211
|
-
*
|
|
212
|
-
* For more information, see the {@link guide/bootstrap Bootstrap guide}.
|
|
213
|
-
*
|
|
214
|
-
* AngularJS will detect if it has been loaded into the browser more than once and only allow the
|
|
215
|
-
* first loaded script to be bootstrapped and will report a warning to the browser console for
|
|
216
|
-
* each of the subsequent scripts. This prevents strange results in applications, where otherwise
|
|
217
|
-
* multiple instances of AngularJS try to work on the DOM.
|
|
218
|
-
*
|
|
219
|
-
* <div class="alert alert-warning">
|
|
220
|
-
* **Note:** Protractor based end-to-end tests cannot use this function to bootstrap manually.
|
|
221
|
-
* They must use {@link ng.directive:ngApp ngApp}.
|
|
222
|
-
* </div>
|
|
223
|
-
*
|
|
224
|
-
* <div class="alert alert-warning">
|
|
225
|
-
* **Note:** Do not bootstrap the app on an element with a directive that uses {@link ng.$compile#transclusion transclusion},
|
|
226
|
-
* such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and {@link ngRoute.ngView `ngView`}.
|
|
227
|
-
* Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},
|
|
228
|
-
* causing animations to stop working and making the injector inaccessible from outside the app.
|
|
229
|
-
* </div>
|
|
230
|
-
*
|
|
231
|
-
* ```html
|
|
232
|
-
* <!doctype html>
|
|
233
|
-
* <html>
|
|
234
|
-
* <body>
|
|
235
|
-
* <div ng-controller="WelcomeController">
|
|
236
|
-
* {{greeting}}
|
|
237
|
-
* </div>
|
|
238
|
-
*
|
|
239
|
-
* <script src="angular.js"></script>
|
|
240
|
-
* <script>
|
|
241
|
-
* let app = angular.module('demo', [])
|
|
242
|
-
* .controller('WelcomeController', function($scope) {
|
|
243
|
-
* $scope.greeting = 'Welcome!';
|
|
244
|
-
* });
|
|
245
|
-
* angular.bootstrap(document, ['demo']);
|
|
246
|
-
* </script>
|
|
247
|
-
* </body>
|
|
248
|
-
* </html>
|
|
249
|
-
* ```
|
|
250
|
-
*
|
|
251
|
-
* @param {string | Element | Document} element DOM element which is the root of AngularJS application.
|
|
252
|
-
* @param {Array<string | Function | any[]>=} modules an array of modules to load into the application.
|
|
253
|
-
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
|
254
|
-
* function that will be invoked by the injector as a `config` block.
|
|
255
|
-
* See: {@link angular.module modules}
|
|
256
|
-
* @param {AngularBootstrapConfig} [config] an object for defining configuration options for the application. The
|
|
257
|
-
* following keys are supported:
|
|
258
|
-
*
|
|
259
|
-
* * `strictDi` - disable automatic function annotation for the application. This is meant to
|
|
260
|
-
* assist in finding bugs which break minified code. Defaults to `false`.
|
|
261
|
-
*
|
|
262
|
-
* @returns {any} InjectorService - Returns the newly created injector for this app.
|
|
263
|
-
*/
|
|
264
|
-
bootstrap(element: string | Element | Document, modules?: Array<string | Function | any[]> | undefined, config?: AngularBootstrapConfig): any;
|
|
265
|
-
resumeBootstrap(extraModules: any): any;
|
|
266
|
-
/**
|
|
180
|
+
* Configure several aspects of error handling if used as a setter or return the
|
|
181
|
+
* current configuration if used as a getter.
|
|
267
182
|
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
* @
|
|
183
|
+
* Omitted or undefined options will leave the corresponding configuration values unchanged.
|
|
184
|
+
*
|
|
185
|
+
* @param {import('./shared/utils').ErrorHandlingConfig} [config]
|
|
186
|
+
* @returns {import('./shared/utils').ErrorHandlingConfig}
|
|
271
187
|
*/
|
|
272
|
-
|
|
188
|
+
errorHandlingConfig(config?: import("./shared/utils").ErrorHandlingConfig): import("./shared/utils").ErrorHandlingConfig;
|
|
273
189
|
/**
|
|
190
|
+
* Use this function to manually start up AngularJS application.
|
|
274
191
|
*
|
|
275
|
-
*
|
|
276
|
-
* modules.
|
|
277
|
-
* All modules (AngularJS core or 3rd party) that should be available to an application must be
|
|
278
|
-
* registered using this mechanism.
|
|
192
|
+
* For more information, see the {@link guide/bootstrap Bootstrap guide}.
|
|
279
193
|
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
194
|
+
* AngularJS will detect if it has been loaded into the browser more than once and only allow the
|
|
195
|
+
* first loaded script to be bootstrapped and will report a warning to the browser console for
|
|
196
|
+
* each of the subsequent scripts. This prevents strange results in applications, where otherwise
|
|
197
|
+
* multiple instances of AngularJS try to work on the DOM.
|
|
282
198
|
*
|
|
199
|
+
* <div class="alert alert-warning">
|
|
200
|
+
* **Note:** Protractor based end-to-end tests cannot use this function to bootstrap manually.
|
|
201
|
+
* They must use {@link ng.directive:ngApp ngApp}.
|
|
202
|
+
* </div>
|
|
283
203
|
*
|
|
284
|
-
*
|
|
204
|
+
* <div class="alert alert-warning">
|
|
205
|
+
* **Note:** Do not bootstrap the app on an element with a directive that uses {@link ng.$compile#transclusion transclusion},
|
|
206
|
+
* such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and {@link ngRoute.ngView `ngView`}.
|
|
207
|
+
* Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},
|
|
208
|
+
* causing animations to stop working and making the injector inaccessible from outside the app.
|
|
209
|
+
* </div>
|
|
285
210
|
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
211
|
+
* ```html
|
|
212
|
+
* <!doctype html>
|
|
213
|
+
* <html>
|
|
214
|
+
* <body>
|
|
215
|
+
* <div ng-controller="WelcomeController">
|
|
216
|
+
* {{greeting}}
|
|
217
|
+
* </div>
|
|
288
218
|
*
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
* $locationProvider.hashPrefix('!');
|
|
300
|
-
* }]);
|
|
219
|
+
* <script src="angular.js"></script>
|
|
220
|
+
* <script>
|
|
221
|
+
* let app = angular.module('demo', [])
|
|
222
|
+
* .controller('WelcomeController', function($scope) {
|
|
223
|
+
* $scope.greeting = 'Welcome!';
|
|
224
|
+
* });
|
|
225
|
+
* angular.bootstrap(document, ['demo']);
|
|
226
|
+
* </script>
|
|
227
|
+
* </body>
|
|
228
|
+
* </html>
|
|
301
229
|
* ```
|
|
302
230
|
*
|
|
303
|
-
*
|
|
231
|
+
* @param {string | Element | Document} element DOM element which is the root of AngularJS application.
|
|
232
|
+
* @param {Array<String|any>} [modules] an array of modules to load into the application.
|
|
233
|
+
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
|
234
|
+
* function that will be invoked by the injector as a `config` block.
|
|
235
|
+
* See: {@link angular.module modules}
|
|
236
|
+
* @param {AngularBootstrapConfig} [config] an object for defining configuration options for the application. The
|
|
237
|
+
* following keys are supported:
|
|
304
238
|
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
* ```
|
|
239
|
+
* * `strictDi` - disable automatic function annotation for the application. This is meant to
|
|
240
|
+
* assist in finding bugs which break minified code. Defaults to `false`.
|
|
308
241
|
*
|
|
309
|
-
*
|
|
310
|
-
|
|
311
|
-
|
|
242
|
+
* @returns {any} InjectorService - Returns the newly created injector for this app.
|
|
243
|
+
*/
|
|
244
|
+
bootstrap(element: string | Element | Document, modules?: Array<string | any>, config?: AngularBootstrapConfig): any;
|
|
245
|
+
resumeBootstrap(extraModules: any): any;
|
|
246
|
+
/**
|
|
312
247
|
*
|
|
313
|
-
* @param {
|
|
314
|
-
* @param {
|
|
315
|
-
*
|
|
316
|
-
* @param {Function=} configFn Optional configuration function for the module. Same as
|
|
317
|
-
* {@link import('./types').Module#config Module#config()}.
|
|
318
|
-
* @returns {import('./types').Module} new module with the {@link import('./types').Module} api.
|
|
248
|
+
* @param {any[]} modules
|
|
249
|
+
* @param {boolean?} strictDi
|
|
250
|
+
* @returns {import("./types").InjectorService}
|
|
319
251
|
*/
|
|
320
|
-
|
|
252
|
+
injector(modules: any[], strictDi: boolean | null): import("./types").InjectorService;
|
|
321
253
|
/**
|
|
322
254
|
* @module angular
|
|
323
255
|
* @function reloadWithDebugInfo
|
|
@@ -334,10 +266,6 @@ export class Angular {
|
|
|
334
266
|
* Configuration option for AngularTS bootstrap process.
|
|
335
267
|
*/
|
|
336
268
|
export type AngularBootstrapConfig = {
|
|
337
|
-
/**
|
|
338
|
-
* - Indicates whether debug information should be enabled. Setting this to `false` can improve performance but will disable some debugging features.
|
|
339
|
-
*/
|
|
340
|
-
debugInfoEnabled: boolean;
|
|
341
269
|
/**
|
|
342
270
|
* - Disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. Defaults to `false`.
|
|
343
271
|
*/
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
* JQLite both a function and an array-like data structure for manipulation of DOM, linking elements to expando cache,
|
|
3
3
|
* and execution of chain functions.
|
|
4
4
|
*
|
|
5
|
-
* @param {string|
|
|
5
|
+
* @param {string|Node|JQLite|ArrayLike<Element>|(() => void)} element
|
|
6
6
|
* @returns {JQLite}
|
|
7
7
|
*/
|
|
8
|
-
export function JQLite(element: string |
|
|
8
|
+
export function JQLite(element: string | Node | JQLite | ArrayLike<Element> | (() => void)): JQLite;
|
|
9
9
|
export class JQLite {
|
|
10
10
|
/**
|
|
11
11
|
* JQLite both a function and an array-like data structure for manipulation of DOM, linking elements to expando cache,
|
|
12
12
|
* and execution of chain functions.
|
|
13
13
|
*
|
|
14
|
-
* @param {string|
|
|
14
|
+
* @param {string|Node|JQLite|ArrayLike<Element>|(() => void)} element
|
|
15
15
|
* @returns {JQLite}
|
|
16
16
|
*/
|
|
17
|
-
constructor(element: string |
|
|
17
|
+
constructor(element: string | Node | JQLite | ArrayLike<Element> | (() => void));
|
|
18
18
|
/**
|
|
19
19
|
* Remove all child nodes of the set of matched elements from the DOM and clears CACHE data, associated with the node.
|
|
20
20
|
* @returns {JQLite} The current instance of JQLite.
|
|
@@ -101,7 +101,7 @@ export class JQLite {
|
|
|
101
101
|
* @returns {JQLite|any} - The retrieved data if acting as a getter. Otherwise, returns undefined.
|
|
102
102
|
*/
|
|
103
103
|
data(key: string | any, value?: any): JQLite | any;
|
|
104
|
-
replaceWith(arg1: any):
|
|
104
|
+
replaceWith(arg1: any): this;
|
|
105
105
|
children(): JQLite;
|
|
106
106
|
/**
|
|
107
107
|
* @param {string} node
|