@angular-wave/angular.ts 0.0.70 → 0.0.72
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/animations/animate-children-directive.md +1 -1
- package/src/animations/animate-css-driver.js +1 -1
- package/src/animations/animate-css.html +2 -2
- package/src/animations/animate-js.html +1 -1
- package/src/animations/animate-queue.js +4 -4
- package/src/animations/animate-swap.md +1 -1
- package/src/{core/animate → animations}/animate.html +1 -1
- package/src/{core/animate → animations}/animate.js +4 -120
- package/src/animations/raf-scheduler.js +7 -3
- package/src/animations/raf-scheduler.spec.js +3 -3
- package/src/animations/shared.js +16 -7
- package/src/binding.spec.js +4 -3
- package/src/core/compile/attributes.js +326 -0
- package/src/core/compile/compile.js +76 -433
- package/src/core/compile/compile.spec.js +45 -28
- package/src/core/di/injector.md +1 -1
- package/src/core/di/ng-module.js +46 -3
- package/src/core/interpolate/interpolate.js +1 -12
- package/src/core/location/location.js +26 -4
- package/src/core/parser/parse.js +50 -47
- package/src/core/prop.spec.js +15 -11
- package/src/core/scope/scope.js +4 -7
- package/src/directive/bind/bind.spec.js +80 -44
- package/src/directive/class/class.js +43 -14
- package/src/directive/class/class.spec.js +7 -4
- package/src/directive/form/form.js +3 -1
- package/src/directive/form/form.spec.js +3 -4
- package/src/directive/if/if-animate-css.html +5 -7
- package/src/directive/if/if.js +1 -1
- package/src/directive/if/if.spec.js +3 -2
- package/src/directive/include/include.js +1 -1
- package/src/directive/input/input.spec.js +6 -4
- package/src/directive/list/list.spec.js +4 -2
- package/src/directive/messages/messages.js +5 -4
- package/src/directive/messages/messages.spec.js +4 -4
- package/src/directive/model/model.spec.js +4 -3
- package/src/directive/model-options/model-options.spec.js +3 -1
- package/src/directive/repeat/repeat.md +1 -1
- package/src/directive/repeat/repeat.spec.js +1 -1
- package/src/directive/select/select.spec.js +3 -3
- package/src/directive/show-hide/show-hide.js +36 -6
- package/src/directive/switch/switch.spec.js +5 -2
- package/src/directive/validators/validators.spec.js +6 -4
- package/src/loader.js +1 -2
- package/src/public.js +22 -10
- package/src/router/state/state-object.js +4 -9
- package/src/router/url/url-matcher.js +1 -1
- package/src/router/url/url-rule.js +5 -1
- package/src/router/url/url-service.js +1 -1
- package/src/services/anchor-scroll.html +1 -1
- package/src/shared/jqlite/jqlite.js +14 -2
- package/src/types.js +1 -1
- package/types/animations/animate-css-driver.d.ts +1 -1
- package/types/animations/animate-queue.d.ts +1 -2
- package/types/{core/animate → animations}/animate.d.ts +2 -12
- package/types/animations/raf-scheduler.d.ts +7 -2
- package/types/animations/shared.d.ts +11 -6
- package/types/core/compile/attributes.d.ts +101 -0
- package/types/core/compile/compile.d.ts +10 -67
- package/types/core/di/ng-module.d.ts +55 -12
- package/types/core/interpolate/interpolate.d.ts +1 -12
- package/types/core/location/location.d.ts +12 -2
- package/types/core/parser/parse.d.ts +10 -10
- package/types/core/scope/scope.d.ts +20 -20
- package/types/directive/form/form.d.ts +2 -11
- package/types/router/state/state-object.d.ts +0 -2
- package/types/router/url/url-matcher.d.ts +2 -2
- package/types/router/url/url-rule.d.ts +2 -1
- package/types/shared/jqlite/jqlite.d.ts +10 -6
- package/types/types.d.ts +1 -1
- package/src/animations/module.js +0 -25
- package/src/core/animate/animate-css.js +0 -88
- package/src/core/animate/anomate.md +0 -13
- package/types/animations/module.d.ts +0 -1
- package/types/core/animate/animate-css.d.ts +0 -19
- /package/src/{core/animate → animations}/animate-runner.js +0 -0
- /package/src/{core/animate → animations}/animate.spec.js +0 -0
- /package/src/{core/animate → animations}/helpers.js +0 -0
- /package/types/{core/animate → animations}/animate-runner.d.ts +0 -0
- /package/types/{core/animate → animations}/helpers.d.ts +0 -0
package/src/public.js
CHANGED
|
@@ -53,16 +53,12 @@ import { ngModelOptionsDirective } from "./directive/model-options/model-options
|
|
|
53
53
|
import { ngAttributeAliasDirectives } from "./directive/attrs/attrs";
|
|
54
54
|
import { ngEventDirectives } from "./directive/events/events";
|
|
55
55
|
import { AnchorScrollProvider } from "./services/anchor-scroll";
|
|
56
|
-
import {
|
|
57
|
-
AnimateProvider,
|
|
58
|
-
CoreAnimateQueueProvider,
|
|
59
|
-
} from "./core/animate/animate";
|
|
56
|
+
import { AnimateProvider } from "./animations/animate";
|
|
60
57
|
import { BrowserProvider } from "./services/browser";
|
|
61
|
-
import { CoreAnimateCssProvider } from "./core/animate/animate-css";
|
|
62
58
|
import {
|
|
63
59
|
AnimateAsyncRunFactoryProvider,
|
|
64
60
|
AnimateRunnerFactoryProvider,
|
|
65
|
-
} from "./
|
|
61
|
+
} from "./animations/animate-runner";
|
|
66
62
|
import {
|
|
67
63
|
CacheFactoryProvider,
|
|
68
64
|
TemplateCacheProvider,
|
|
@@ -89,7 +85,6 @@ import { $$TaskTrackerFactoryProvider } from "./core/task-tracker-factory";
|
|
|
89
85
|
import { TemplateRequestProvider } from "./services/template-request";
|
|
90
86
|
import { $TimeoutProvider } from "./core/timeout/timeout";
|
|
91
87
|
import { SanitizeUriProvider } from "./core/sanitize/sanitize-uri";
|
|
92
|
-
import { initAnimateModule } from "./animations/module";
|
|
93
88
|
import {
|
|
94
89
|
ngMessageDefaultDirective,
|
|
95
90
|
ngMessageDirective,
|
|
@@ -112,6 +107,16 @@ import {
|
|
|
112
107
|
ngShowAriaDirective,
|
|
113
108
|
ngValueAriaDirective,
|
|
114
109
|
} from "./directive/aria/aria";
|
|
110
|
+
import { $AnimateCssProvider } from "./animations/animate-css";
|
|
111
|
+
import { $$AnimateQueueProvider } from "./animations/animate-queue";
|
|
112
|
+
import { $$AnimateJsProvider } from "./animations/animate-js";
|
|
113
|
+
import { $$AnimationProvider } from "./animations/animation";
|
|
114
|
+
import { RafSchedulerProvider } from "./animations/raf-scheduler";
|
|
115
|
+
import { $$AnimateCacheProvider } from "./animations/animate-cache";
|
|
116
|
+
import { $$AnimateCssDriverProvider } from "./animations/animate-css-driver";
|
|
117
|
+
import { $$AnimateJsDriverProvider } from "./animations/animate-js-driver";
|
|
118
|
+
import { ngAnimateSwapDirective } from "./animations/animate-swap";
|
|
119
|
+
import { $$AnimateChildrenDirective } from "./animations/animate-children-directive";
|
|
115
120
|
|
|
116
121
|
/**
|
|
117
122
|
* @type {string} `version` from `package.json`, injected by Rollup plugin
|
|
@@ -190,6 +195,8 @@ export function publishExternalAPI(angular) {
|
|
|
190
195
|
})
|
|
191
196
|
.directive({
|
|
192
197
|
input: hiddenInputBrowserCacheDirective,
|
|
198
|
+
ngAnimateSwap: ngAnimateSwapDirective,
|
|
199
|
+
ngAnimateChildren: $$AnimateChildrenDirective,
|
|
193
200
|
ngChecked: ngCheckedAriaDirective,
|
|
194
201
|
ngClick: ngClickAriaDirective,
|
|
195
202
|
ngDblclick: ngDblclickAriaDirective,
|
|
@@ -208,8 +215,13 @@ export function publishExternalAPI(angular) {
|
|
|
208
215
|
$aria: AriaProvider,
|
|
209
216
|
$anchorScroll: AnchorScrollProvider,
|
|
210
217
|
$animate: AnimateProvider,
|
|
211
|
-
|
|
212
|
-
|
|
218
|
+
$$animation: $$AnimationProvider,
|
|
219
|
+
$animateCss: $AnimateCssProvider,
|
|
220
|
+
$$animateCssDriver: $$AnimateCssDriverProvider,
|
|
221
|
+
$$animateJs: $$AnimateJsProvider,
|
|
222
|
+
$$animateJsDriver: $$AnimateJsDriverProvider,
|
|
223
|
+
$$animateCache: $$AnimateCacheProvider,
|
|
224
|
+
$$animateQueue: $$AnimateQueueProvider,
|
|
213
225
|
$$AnimateRunner: AnimateRunnerFactoryProvider,
|
|
214
226
|
$$animateAsyncRun: AnimateAsyncRunFactoryProvider,
|
|
215
227
|
$browser: BrowserProvider,
|
|
@@ -227,6 +239,7 @@ export function publishExternalAPI(angular) {
|
|
|
227
239
|
$location: $LocationProvider,
|
|
228
240
|
$log: $LogProvider,
|
|
229
241
|
$parse: $ParseProvider,
|
|
242
|
+
$$rAFScheduler: RafSchedulerProvider,
|
|
230
243
|
$rootScope: $RootScopeProvider,
|
|
231
244
|
$q: $QProvider,
|
|
232
245
|
$$q: $$QProvider,
|
|
@@ -242,7 +255,6 @@ export function publishExternalAPI(angular) {
|
|
|
242
255
|
)
|
|
243
256
|
.info({ version: VERSION });
|
|
244
257
|
|
|
245
|
-
initAnimateModule(angular);
|
|
246
258
|
initRouter(angular);
|
|
247
259
|
return ng;
|
|
248
260
|
}
|
|
@@ -22,12 +22,10 @@ export class StateObject {
|
|
|
22
22
|
* @returns {StateObject} an internal State object
|
|
23
23
|
*/
|
|
24
24
|
static create(stateDecl) {
|
|
25
|
-
const state =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
StateObject.prototype,
|
|
30
|
-
);
|
|
25
|
+
const state = Object.setPrototypeOf(
|
|
26
|
+
Object.assign({}, stateDecl),
|
|
27
|
+
StateObject.prototype,
|
|
28
|
+
);
|
|
31
29
|
stateDecl.$$state = () => state;
|
|
32
30
|
state.self = stateDecl;
|
|
33
31
|
state.__stateObjectCache = {
|
|
@@ -110,9 +108,6 @@ export class StateObject {
|
|
|
110
108
|
return this.fqn();
|
|
111
109
|
}
|
|
112
110
|
}
|
|
113
|
-
/** Predicate which returns true if the object is an class with @State() decorator */
|
|
114
|
-
StateObject.isStateClass = (stateDecl) =>
|
|
115
|
-
isFunction(stateDecl) && stateDecl["__uiRouterState"] === true;
|
|
116
111
|
/** Predicate which returns true if the object is a [[StateDeclaration]] object */
|
|
117
112
|
StateObject.isStateDeclaration = (obj) => isFunction(obj["$$state"]);
|
|
118
113
|
/** Predicate which returns true if the object is an internal [[StateObject]] object */
|
|
@@ -203,7 +203,11 @@ export class BaseUrlRule {
|
|
|
203
203
|
this.match = match;
|
|
204
204
|
this.type = "RAW";
|
|
205
205
|
this.$id = -1;
|
|
206
|
-
this.
|
|
206
|
+
this._group = undefined;
|
|
207
207
|
this.handler = handler || ((x) => x);
|
|
208
208
|
}
|
|
209
|
+
|
|
210
|
+
matchPriority() {
|
|
211
|
+
return 0 - this.$id;
|
|
212
|
+
}
|
|
209
213
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<!--
|
|
10
10
|
<script src="https://cdn.jsdelivr.net/npm/angular@1.8.3/angular.js"></script>
|
|
11
11
|
<script src="https://cdn.jsdelivr.net/npm/angular-animate@1.8.3/angular-animate.js"></script>
|
|
12
|
-
<script>window.angular.module("test", [
|
|
12
|
+
<script>window.angular.module("test", [])</script> -->
|
|
13
13
|
|
|
14
14
|
<script type="module" src="/src/index.js"></script>
|
|
15
15
|
<script>
|
|
@@ -62,7 +62,7 @@ const BOOLEAN_ELEMENTS = {};
|
|
|
62
62
|
* JQLite both a function and an array-like data structure for manipulation of DOM, linking elements to expando cache,
|
|
63
63
|
* and execution of chain functions.
|
|
64
64
|
*
|
|
65
|
-
* @param {string|Node|JQLite|ArrayLike<Element>|(() => void)|Window} element
|
|
65
|
+
* @param {string|Node|Node[]|NodeList|JQLite|ArrayLike<Element>|(() => void)|Window} element
|
|
66
66
|
* @returns {JQLite}
|
|
67
67
|
*/
|
|
68
68
|
export function JQLite(element) {
|
|
@@ -116,6 +116,18 @@ JQLite.prototype = {
|
|
|
116
116
|
length: 0,
|
|
117
117
|
};
|
|
118
118
|
|
|
119
|
+
/**
|
|
120
|
+
* @returns {Element[]}
|
|
121
|
+
*/
|
|
122
|
+
JQLite.prototype.elements = function () {
|
|
123
|
+
/** @type {Element[]} */
|
|
124
|
+
let elements = [];
|
|
125
|
+
for (let index = 0; index < this.length; index++) {
|
|
126
|
+
elements.push(this[index]);
|
|
127
|
+
}
|
|
128
|
+
return elements;
|
|
129
|
+
};
|
|
130
|
+
|
|
119
131
|
/**
|
|
120
132
|
* Remove all child nodes of the set of matched elements from the DOM and clears CACHE data, associated with the node.
|
|
121
133
|
* @returns {JQLite} The current instance of JQLite.
|
|
@@ -233,7 +245,7 @@ JQLite.prototype.on = function (type, fn) {
|
|
|
233
245
|
* Removes an event listener to each element in JQLite collection.
|
|
234
246
|
*
|
|
235
247
|
* @param {string} type - The event type(s) to remove listener from
|
|
236
|
-
* @param {Function} fn - The function to remove from event type.
|
|
248
|
+
* @param {Function} [fn] - The function to remove from event type.
|
|
237
249
|
* @returns {JQLite}
|
|
238
250
|
*/
|
|
239
251
|
JQLite.prototype.off = function (type, fn) {
|
package/src/types.js
CHANGED
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
/**
|
|
218
218
|
|
|
219
219
|
*
|
|
220
|
-
* @typedef {function(TScope, CloneAttachFunction
|
|
220
|
+
* @typedef {function(TScope|Function, CloneAttachFunction=, import('./shared/jqlite/jqlite').JQLite=, string=): import('./shared/jqlite/jqlite').JQLite} TranscludeFunction
|
|
221
221
|
*/
|
|
222
222
|
|
|
223
223
|
/**
|
|
@@ -4,7 +4,7 @@ export class $$AnimateCssDriverProvider {
|
|
|
4
4
|
/**
|
|
5
5
|
* @returns {Function}
|
|
6
6
|
*/
|
|
7
|
-
$get: (string | (($animateCss: any, $$AnimateRunner: typeof import("
|
|
7
|
+
$get: (string | (($animateCss: any, $$AnimateRunner: typeof import("./animate-runner").AnimateRunner, $rootElement: JQLite) => (animationDetails: any) => any))[];
|
|
8
8
|
}
|
|
9
9
|
export namespace $$AnimateCssDriverProvider {
|
|
10
10
|
let $inject: string[];
|
|
@@ -6,7 +6,7 @@ export class $$AnimateQueueProvider {
|
|
|
6
6
|
cancel: any[];
|
|
7
7
|
join: any[];
|
|
8
8
|
};
|
|
9
|
-
$get: (string | (($rootScope: any, $
|
|
9
|
+
$get: (string | (($rootScope: any, $injector: any, $$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,4 +17,3 @@ export class $$AnimateQueueProvider {
|
|
|
17
17
|
export namespace $$AnimateQueueProvider {
|
|
18
18
|
let $inject: string[];
|
|
19
19
|
}
|
|
20
|
-
import { JQLite } from "../shared/jqlite/jqlite";
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
export function CoreAnimateQueueProvider(): void;
|
|
2
|
-
export class CoreAnimateQueueProvider {
|
|
3
|
-
$get: (string | (($$AnimateRunner: any, $rootScope: any) => {
|
|
4
|
-
enabled: () => void;
|
|
5
|
-
on: () => void;
|
|
6
|
-
off: () => void;
|
|
7
|
-
pin: () => void;
|
|
8
|
-
push(element: any, event: any, options: any, domOperation: any): any;
|
|
9
|
-
}))[];
|
|
10
|
-
}
|
|
11
1
|
export function domInsert(element: any, parentElement: any, afterElement: any): void;
|
|
12
2
|
export function AnimateProvider($provide: any): void;
|
|
13
3
|
export class AnimateProvider {
|
|
@@ -241,7 +231,7 @@ export class AnimateProvider {
|
|
|
241
231
|
* @example
|
|
242
232
|
<example module="animationExample" deps="angular-animate.js" animations="true" name="animate-cancel">
|
|
243
233
|
<file name="app.js">
|
|
244
|
-
angular.module('animationExample', [
|
|
234
|
+
angular.module('animationExample', []).component('cancelExample', {
|
|
245
235
|
templateUrl: 'template.html',
|
|
246
236
|
controller: function($element, $animate) {
|
|
247
237
|
this.runner = null;
|
|
@@ -427,4 +417,4 @@ export type AnimationOptions = {
|
|
|
427
417
|
*/
|
|
428
418
|
to: string;
|
|
429
419
|
};
|
|
430
|
-
import { JQLite } from "
|
|
420
|
+
import { JQLite } from "../shared/jqlite/jqlite";
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Creates a requestAnimationFrame scheduler.
|
|
9
|
-
* @returns {RafScheduler} The scheduler object.
|
|
10
9
|
*/
|
|
11
|
-
export function
|
|
10
|
+
export function RafSchedulerProvider(): void;
|
|
11
|
+
export class RafSchedulerProvider {
|
|
12
|
+
/**
|
|
13
|
+
* @returns {RafScheduler} The scheduler object.
|
|
14
|
+
*/
|
|
15
|
+
$get: () => RafScheduler;
|
|
16
|
+
}
|
|
12
17
|
export type RafSchedulerFunction = Function;
|
|
13
18
|
export type RafSchedulerObject = {
|
|
14
19
|
/**
|
|
@@ -6,12 +6,17 @@ export function packageStyles(options: any): {
|
|
|
6
6
|
};
|
|
7
7
|
export function pendClasses(classes: any, fix: any, isPrefix: any): string;
|
|
8
8
|
export function removeFromArray(arr: any, val: any): void;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export function
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {JQLite|Node} element
|
|
12
|
+
* @returns {JQLite}
|
|
13
|
+
*/
|
|
14
|
+
export function stripCommentsFromElement(element: JQLite | Node): JQLite;
|
|
15
|
+
/**
|
|
16
|
+
* @param {JQLite|Node} element
|
|
17
|
+
* @returns {Node}
|
|
18
|
+
*/
|
|
19
|
+
export function extractElementNode(element: JQLite | Node): Node;
|
|
15
20
|
export function applyAnimationClassesFactory(): (element: any, options: any) => void;
|
|
16
21
|
export function prepareAnimationOptions(options: any): any;
|
|
17
22
|
export function applyAnimationStyles(element: any, options: any): void;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export class Attributes {
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param {import('../scope/scope').Scope} $rootScope
|
|
5
|
+
* @param {*} $animate
|
|
6
|
+
* @param {import("../exception-handler").ExceptionHandlerProvider} $exceptionHandler
|
|
7
|
+
* @param {*} $sce
|
|
8
|
+
* @param {import('../../shared/jqlite/jqlite').JQLite} [element]
|
|
9
|
+
* @param {*} [attributesToCopy]
|
|
10
|
+
*/
|
|
11
|
+
constructor($rootScope: import("../scope/scope").Scope, $animate: any, $exceptionHandler: import("../exception-handler").ExceptionHandlerProvider, $sce: any, element?: import("../../shared/jqlite/jqlite").JQLite, attributesToCopy?: any);
|
|
12
|
+
$rootScope: import("../scope/scope").Scope;
|
|
13
|
+
$animate: any;
|
|
14
|
+
$exceptionHandler: any;
|
|
15
|
+
$sce: any;
|
|
16
|
+
$attr: {};
|
|
17
|
+
$$element: import("../../shared/jqlite/jqlite").JQLite;
|
|
18
|
+
/**
|
|
19
|
+
* @ngdoc method
|
|
20
|
+
* @name $compile.directive.Attributes#$normalize
|
|
21
|
+
* @kind function
|
|
22
|
+
*
|
|
23
|
+
* @description
|
|
24
|
+
* Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or
|
|
25
|
+
* `data-`) to its normalized, camelCase form.
|
|
26
|
+
*
|
|
27
|
+
* Also there is special case for Moz prefix starting with upper case letter.
|
|
28
|
+
*
|
|
29
|
+
* For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}
|
|
30
|
+
*
|
|
31
|
+
* @param {string} name Name to normalize
|
|
32
|
+
*/
|
|
33
|
+
$normalize: typeof directiveNormalize;
|
|
34
|
+
/**
|
|
35
|
+
* @ngdoc method
|
|
36
|
+
* @name $compile.directive.Attributes#$addClass
|
|
37
|
+
* @kind function
|
|
38
|
+
*
|
|
39
|
+
* @description
|
|
40
|
+
* Adds the CSS class value specified by the classVal parameter to the element. If animations
|
|
41
|
+
* are enabled then an animation will be triggered for the class addition.
|
|
42
|
+
*
|
|
43
|
+
* @param {string} classVal The className value that will be added to the element
|
|
44
|
+
*/
|
|
45
|
+
$addClass(classVal: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* @ngdoc method
|
|
48
|
+
* @name $compile.directive.Attributes#$removeClass
|
|
49
|
+
* @kind function
|
|
50
|
+
*
|
|
51
|
+
* @description
|
|
52
|
+
* Removes the CSS class value specified by the classVal parameter from the element. If
|
|
53
|
+
* animations are enabled then an animation will be triggered for the class removal.
|
|
54
|
+
*
|
|
55
|
+
* @param {string} classVal The className value that will be removed from the element
|
|
56
|
+
*/
|
|
57
|
+
$removeClass(classVal: string): void;
|
|
58
|
+
/**
|
|
59
|
+
* @ngdoc method
|
|
60
|
+
* @name $compile.directive.Attributes#$updateClass
|
|
61
|
+
* @kind function
|
|
62
|
+
*
|
|
63
|
+
* @description
|
|
64
|
+
* Adds and removes the appropriate CSS class values to the element based on the difference
|
|
65
|
+
* between the new and old CSS class values (specified as newClasses and oldClasses).
|
|
66
|
+
*
|
|
67
|
+
* @param {string} newClasses The current CSS className value
|
|
68
|
+
* @param {string} oldClasses The former CSS className value
|
|
69
|
+
*/
|
|
70
|
+
$updateClass(newClasses: string, oldClasses: string): void;
|
|
71
|
+
/**
|
|
72
|
+
* Set a normalized attribute on the element in a way such that all directives
|
|
73
|
+
* can share the attribute. This function properly handles boolean attributes.
|
|
74
|
+
* @param {string} key Normalized key. (ie ngAttribute)
|
|
75
|
+
* @param {string|boolean} value The value to set. If `null` attribute will be deleted.
|
|
76
|
+
* @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.
|
|
77
|
+
* Defaults to true.
|
|
78
|
+
* @param {string=} attrName Optional none normalized name. Defaults to key.
|
|
79
|
+
*/
|
|
80
|
+
$set(key: string, value: string | boolean, writeAttr?: boolean | undefined, attrName?: string | undefined): void;
|
|
81
|
+
/**
|
|
82
|
+
* Observes an interpolated attribute.
|
|
83
|
+
*
|
|
84
|
+
* The observer function will be invoked once during the next `$digest` following
|
|
85
|
+
* compilation. The observer is then invoked whenever the interpolated value
|
|
86
|
+
* changes.
|
|
87
|
+
*
|
|
88
|
+
* @param {string} key Normalized key. (ie ngAttribute) .
|
|
89
|
+
* @param {any} fn Function that will be called whenever
|
|
90
|
+
the interpolated value of the attribute changes.
|
|
91
|
+
* See the {@link guide/interpolation#how-text-and-attribute-bindings-work Interpolation
|
|
92
|
+
* guide} for more info.
|
|
93
|
+
* @returns {function()} Returns a deregistration function for this observer.
|
|
94
|
+
*/
|
|
95
|
+
$observe(key: string, fn: any): () => any;
|
|
96
|
+
$$observers: any;
|
|
97
|
+
setSpecialAttr(element: any, attrName: any, value: any): void;
|
|
98
|
+
sanitizeSrcset(value: any, invokeType: any): any;
|
|
99
|
+
srcset: any;
|
|
100
|
+
}
|
|
101
|
+
import { directiveNormalize } from "../../shared/utils";
|
|
@@ -2,11 +2,6 @@ export function $CompileProvider($provide: any, $$sanitizeUriProvider: any): voi
|
|
|
2
2
|
export class $CompileProvider {
|
|
3
3
|
constructor($provide: any, $$sanitizeUriProvider: any);
|
|
4
4
|
/**
|
|
5
|
-
* @ngdoc method
|
|
6
|
-
* @name $compileProvider#directive
|
|
7
|
-
* @kind function
|
|
8
|
-
*
|
|
9
|
-
* @description
|
|
10
5
|
* Register a new directive with the compiler.
|
|
11
6
|
*
|
|
12
7
|
* @param {string|Object} name Name of the directive in camel-case (i.e. `ngBind` which will match
|
|
@@ -18,18 +13,14 @@ export class $CompileProvider {
|
|
|
18
13
|
*/
|
|
19
14
|
directive: (name: string | any, directiveFactory: Function | any[]) => $CompileProvider;
|
|
20
15
|
/**
|
|
21
|
-
* @ngdoc method
|
|
22
|
-
* @name $compileProvider#component
|
|
23
|
-
* @module ng
|
|
24
16
|
* @param {string|Object} name Name of the component in camelCase (i.e. `myComp` which will match `<my-comp>`),
|
|
25
17
|
* or an object map of components where the keys are the names and the values are the component definition objects.
|
|
26
18
|
* @param {Object} options Component definition object (a simplified
|
|
27
|
-
* {
|
|
19
|
+
* {directive definition object}),
|
|
28
20
|
* with the following properties (all optional):
|
|
29
21
|
*
|
|
30
22
|
* - `controller` – `{(string|function()=}` – controller constructor function that should be
|
|
31
|
-
* associated with newly created scope or the name of a {
|
|
32
|
-
* registered controller} if passed as a string. An empty `noop` function by default.
|
|
23
|
+
* associated with newly created scope or the name of a {controller} if passed as a string. An empty `noop` function by default.
|
|
33
24
|
* - `controllerAs` – `{string=}` – identifier name for to reference the controller in the component's scope.
|
|
34
25
|
* If present, the controller will be published to scope under the `controllerAs` name.
|
|
35
26
|
* If not present, this will default to be `$ctrl`.
|
|
@@ -37,7 +28,7 @@ export class $CompileProvider {
|
|
|
37
28
|
* returns an html template as a string which should be used as the contents of this component.
|
|
38
29
|
* Empty string by default.
|
|
39
30
|
*
|
|
40
|
-
* If `template` is a function, then it is {
|
|
31
|
+
* If `template` is a function, then it is {injected} with
|
|
41
32
|
* the following locals:
|
|
42
33
|
*
|
|
43
34
|
* - `$element` - Current element
|
|
@@ -46,7 +37,7 @@ export class $CompileProvider {
|
|
|
46
37
|
* - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html
|
|
47
38
|
* template that should be used as the contents of this component.
|
|
48
39
|
*
|
|
49
|
-
* If `templateUrl` is a function, then it is {
|
|
40
|
+
* If `templateUrl` is a function, then it is {injected} with
|
|
50
41
|
* the following locals:
|
|
51
42
|
*
|
|
52
43
|
* - `$element` - Current element
|
|
@@ -54,57 +45,18 @@ export class $CompileProvider {
|
|
|
54
45
|
*
|
|
55
46
|
* - `bindings` – `{object=}` – defines bindings between DOM attributes and component properties.
|
|
56
47
|
* Component properties are always bound to the component controller and not to the scope.
|
|
57
|
-
* See {
|
|
58
|
-
* - `transclude` – `{boolean=}` – whether {
|
|
48
|
+
* See {`bindToController`}.
|
|
49
|
+
* - `transclude` – `{boolean=}` – whether {content transclusion} is enabled.
|
|
59
50
|
* Disabled by default.
|
|
60
51
|
* - `require` - `{Object<string, string>=}` - requires the controllers of other directives and binds them to
|
|
61
52
|
* this component's controller. The object keys specify the property names under which the required
|
|
62
|
-
* controllers (object values) will be bound. See {
|
|
53
|
+
* controllers (object values) will be bound. See {`require`}.
|
|
63
54
|
* - `$...` – additional properties to attach to the directive factory function and the controller
|
|
64
55
|
* constructor function. (This is used by the component router to annotate)
|
|
65
56
|
*
|
|
66
|
-
* @returns {
|
|
67
|
-
* @description
|
|
68
|
-
* Register a **component definition** with the compiler. This is a shorthand for registering a special
|
|
69
|
-
* type of directive, which represents a self-contained UI component in your application. Such components
|
|
70
|
-
* are always isolated (i.e. `scope: {}`) and are always restricted to elements (i.e. `restrict: 'E'`).
|
|
71
|
-
*
|
|
72
|
-
* Component definitions are very simple and do not require as much configuration as defining general
|
|
73
|
-
* directives. Component definitions usually consist only of a template and a controller backing it.
|
|
74
|
-
*
|
|
75
|
-
* In order to make the definition easier, components enforce best practices like use of `controllerAs`,
|
|
76
|
-
* `bindToController`. They always have **isolate scope** and are restricted to elements.
|
|
77
|
-
*
|
|
78
|
-
* Here are a few examples of how you would usually define components:
|
|
79
|
-
*
|
|
80
|
-
* ```js
|
|
81
|
-
* let myMod = angular.module(...);
|
|
82
|
-
* myMod.component('myComp', {
|
|
83
|
-
* template: '<div>My name is {{$ctrl.name}}</div>',
|
|
84
|
-
* controller: function() {
|
|
85
|
-
* this.name = 'shahar';
|
|
86
|
-
* }
|
|
87
|
-
* });
|
|
88
|
-
*
|
|
89
|
-
* myMod.component('myComp', {
|
|
90
|
-
* template: '<div>My name is {{$ctrl.name}}</div>',
|
|
91
|
-
* bindings: {name: '@'}
|
|
92
|
-
* });
|
|
93
|
-
*
|
|
94
|
-
* myMod.component('myComp', {
|
|
95
|
-
* templateUrl: 'views/my-comp.html',
|
|
96
|
-
* controller: 'MyCtrl',
|
|
97
|
-
* controllerAs: 'ctrl',
|
|
98
|
-
* bindings: {name: '@'}
|
|
99
|
-
* });
|
|
100
|
-
*
|
|
101
|
-
* ```
|
|
102
|
-
* For more examples, and an in-depth guide, see the {@link guide/component component guide}.
|
|
103
|
-
*
|
|
104
|
-
* <br />
|
|
105
|
-
* See also {@link ng.$compileProvider#directive $compileProvider.directive()}.
|
|
57
|
+
* @returns {$CompileProvider} the compile provider itself, for chaining of function calls.
|
|
106
58
|
*/
|
|
107
|
-
component: (name: string | any, options: any) =>
|
|
59
|
+
component: (name: string | any, options: any) => $CompileProvider;
|
|
108
60
|
/**
|
|
109
61
|
* @ngdoc method
|
|
110
62
|
* @name $compileProvider#aHrefSanitizationTrustedUrlList
|
|
@@ -127,11 +79,6 @@ export class $CompileProvider {
|
|
|
127
79
|
*/
|
|
128
80
|
aHrefSanitizationTrustedUrlList: (regexp?: RegExp | undefined) => RegExp | $CompileProvider;
|
|
129
81
|
/**
|
|
130
|
-
* @ngdoc method
|
|
131
|
-
* @name $compileProvider#imgSrcSanitizationTrustedUrlList
|
|
132
|
-
* @kind function
|
|
133
|
-
*
|
|
134
|
-
* @description
|
|
135
82
|
* Retrieves or overrides the default regular expression that is used for determining trusted safe
|
|
136
83
|
* urls during img[src] sanitization.
|
|
137
84
|
*
|
|
@@ -149,10 +96,6 @@ export class $CompileProvider {
|
|
|
149
96
|
imgSrcSanitizationTrustedUrlList: (regexp?: RegExp | undefined) => RegExp | $CompileProvider;
|
|
150
97
|
strictComponentBindingsEnabled: (enabled: any) => boolean | this;
|
|
151
98
|
/**
|
|
152
|
-
* @ngdoc method
|
|
153
|
-
* @name $compileProvider#addPropertySecurityContext
|
|
154
|
-
* @description
|
|
155
|
-
*
|
|
156
99
|
* Defines the security context for DOM properties bound by ng-prop-*.
|
|
157
100
|
*
|
|
158
101
|
* @param {string} elementName The element name or '*' to match any element.
|
|
@@ -161,7 +104,7 @@ export class $CompileProvider {
|
|
|
161
104
|
* @returns {object} `this` for chaining
|
|
162
105
|
*/
|
|
163
106
|
addPropertySecurityContext: (elementName: string, propertyName: string, ctx: string) => object;
|
|
164
|
-
$get: (string | (($injector: import("../../core/di/internal-injector").InjectorService, $interpolate: any, $exceptionHandler:
|
|
107
|
+
$get: (string | (($injector: import("../../core/di/internal-injector").InjectorService, $interpolate: any, $exceptionHandler: import("../exception-handler").ExceptionHandlerProvider, $templateRequest: any, $parse: import("../parser/parse").ParseService, $controller: any, $rootScope: import("../scope/scope").Scope, $sce: any, $animate: any) => ($compileNodes: string | NodeList, transcludeFn: any, maxPriority: any, ignoreDirective: any, previousCompileContext: any) => (scope: any, cloneConnectFn: any, options: any) => JQLite))[];
|
|
165
108
|
}
|
|
166
109
|
export namespace $CompileProvider {
|
|
167
110
|
let $inject: string[];
|
|
@@ -16,7 +16,6 @@ export const CONTROLLER_LITERAL: "$controllerProvider";
|
|
|
16
16
|
*/
|
|
17
17
|
export class NgModule {
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
19
|
* @param {String} name - Name of the module
|
|
21
20
|
* @param {Array<String>} requires - List of modules which the injector will load before the current module
|
|
22
21
|
* @param {Function} [configFn]
|
|
@@ -49,13 +48,13 @@ export class NgModule {
|
|
|
49
48
|
*/
|
|
50
49
|
info(value: any): any;
|
|
51
50
|
/**
|
|
52
|
-
* @param {
|
|
51
|
+
* @param {string} name
|
|
53
52
|
* @param {any} object
|
|
54
53
|
* @returns {NgModule}
|
|
55
54
|
*/
|
|
56
55
|
value(name: string, object: any): NgModule;
|
|
57
56
|
/**
|
|
58
|
-
* @param {
|
|
57
|
+
* @param {string} name
|
|
59
58
|
* @param {any} object
|
|
60
59
|
* @returns {NgModule}
|
|
61
60
|
*/
|
|
@@ -66,14 +65,58 @@ export class NgModule {
|
|
|
66
65
|
* @returns {NgModule}
|
|
67
66
|
*/
|
|
68
67
|
config(configFn: Function): NgModule;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
/**
|
|
69
|
+
* @param {Function} block
|
|
70
|
+
* @returns {NgModule}
|
|
71
|
+
*/
|
|
72
|
+
run(block: Function): NgModule;
|
|
73
|
+
/**
|
|
74
|
+
* @param {string} name
|
|
75
|
+
* @param {*} options
|
|
76
|
+
* @returns {NgModule}
|
|
77
|
+
*/
|
|
78
|
+
component(name: string, options: any): NgModule;
|
|
79
|
+
/**
|
|
80
|
+
* @param {string} name
|
|
81
|
+
* @param {*} providerFunction
|
|
82
|
+
* @returns {NgModule}
|
|
83
|
+
*/
|
|
84
|
+
factory(name: string, providerFunction: any): NgModule;
|
|
85
|
+
/**
|
|
86
|
+
* @param {string} name
|
|
87
|
+
* @param {*} serviceFunction
|
|
88
|
+
* @returns {NgModule}
|
|
89
|
+
*/
|
|
90
|
+
service(name: string, serviceFunction: any): NgModule;
|
|
91
|
+
/**
|
|
92
|
+
* @param {string} name
|
|
93
|
+
* @param {*} providerType
|
|
94
|
+
* @returns {NgModule}
|
|
95
|
+
*/
|
|
96
|
+
provider(name: string, providerType: any): NgModule;
|
|
97
|
+
/**
|
|
98
|
+
* @param {string} name
|
|
99
|
+
* @param {*} decorFn
|
|
100
|
+
* @returns {NgModule}
|
|
101
|
+
*/
|
|
102
|
+
decorator(name: string, decorFn: any): NgModule;
|
|
103
|
+
/**
|
|
104
|
+
* @param {string} name
|
|
105
|
+
* @param {*} directiveFactory
|
|
106
|
+
* @returns {NgModule}
|
|
107
|
+
*/
|
|
108
|
+
directive(name: string, directiveFactory: any): NgModule;
|
|
109
|
+
/**
|
|
110
|
+
* @param {string} name
|
|
111
|
+
* @param {*} animationFactory
|
|
112
|
+
* @returns {NgModule}
|
|
113
|
+
*/
|
|
114
|
+
animation(name: string, animationFactory: any): NgModule;
|
|
77
115
|
filter(name: any, filterFn: any): this;
|
|
78
|
-
|
|
116
|
+
/**
|
|
117
|
+
* @param {string} name
|
|
118
|
+
* @param {*} ctlFn
|
|
119
|
+
* @returns {NgModule}
|
|
120
|
+
*/
|
|
121
|
+
controller(name: string, ctlFn: any): NgModule;
|
|
79
122
|
}
|