@angular-wave/angular.ts 0.0.65 → 0.0.67
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-js.js +6 -0
- package/src/animations/animate-swap.js +3 -0
- package/src/animations/animation.js +1 -1
- package/src/core/compile/compile.js +16 -4
- package/src/core/controller/controller.js +5 -5
- package/src/core/di/injector.js +133 -259
- package/src/core/di/injector.md +3 -3
- package/src/core/di/injector.spec.js +30 -24
- package/src/core/di/internal-injector.js +286 -0
- package/src/core/filter/filter.js +5 -0
- package/src/core/parser/parse.js +1 -12
- package/src/core/parser/parse.spec.js +96 -110
- package/src/core/sce/sce.js +6 -1
- package/src/core/timeout/timeout.js +110 -111
- package/src/directive/input/input.js +32 -726
- package/src/directive/input/input.md +706 -0
- package/src/directive/select/select.js +48 -122
- package/src/directive/select/select.md +74 -0
- package/src/directive/show-hide/show-hide.js +13 -224
- package/src/directive/show-hide/show-hide.md +257 -0
- package/src/filters/limit-to.spec.js +1 -1
- package/src/filters/order-by.spec.js +1 -1
- package/src/index.js +6 -2
- package/src/loader.js +8 -4
- package/src/public.js +1 -7
- package/src/router/services.js +9 -4
- package/src/router/state/state-builder.js +6 -7
- package/src/router/state/state-registry.js +5 -0
- package/src/router/state/state-service.js +1 -1
- package/src/router/state/views.js +2 -1
- package/src/router/state-provider.js +1 -1
- package/src/router/template-factory.js +15 -14
- package/src/router/url/url-service.js +4 -4
- package/src/services/anchor-scroll.js +2 -2
- package/src/services/browser.js +2 -9
- package/src/services/cache-factory.js +0 -67
- package/src/services/cache-factory.md +75 -0
- package/src/services/cookie-reader.js +36 -55
- package/src/services/http/http.js +73 -586
- package/src/services/http/http.md +413 -0
- package/src/services/http-backend/http-backend.js +19 -44
- package/src/services/template-request.js +1 -9
- package/src/shared/jqlite/jqlite.js +4 -69
- package/src/types.js +8 -12
- package/types/animations/animate-js.d.ts +1 -1
- package/types/animations/animate-swap.d.ts +4 -7
- package/types/animations/animation.d.ts +1 -1
- package/types/core/compile/compile.d.ts +7 -7
- package/types/core/controller/controller.d.ts +1 -6
- package/types/core/di/injector.d.ts +13 -7
- package/types/core/di/internal-injector.d.ts +91 -0
- package/types/core/exception-handler.d.ts +1 -1
- package/types/core/filter/filter.d.ts +1 -1
- package/types/core/parser/parse.d.ts +1 -1
- package/types/core/sce/sce.d.ts +1 -1
- package/types/core/timeout/timeout.d.ts +16 -26
- package/types/directive/input/input.d.ts +19 -124
- package/types/directive/select/select.d.ts +7 -74
- package/types/directive/show-hide/show-hide.d.ts +11 -224
- package/types/loader.d.ts +4 -4
- package/types/router/services.d.ts +8 -1
- package/types/router/state/state-builder.d.ts +1 -2
- package/types/router/state/state-registry.d.ts +2 -2
- package/types/router/state/state-service.d.ts +2 -2
- package/types/router/state-provider.d.ts +2 -2
- package/types/router/template-factory.d.ts +16 -16
- package/types/router/url/url-service.d.ts +4 -4
- package/types/services/anchor-scroll.d.ts +1 -1
- package/types/services/browser.d.ts +0 -10
- package/types/services/cache-factory.d.ts +0 -67
- package/types/services/cookie-reader.d.ts +2 -10
- package/types/services/http/http.d.ts +53 -61
- package/types/services/http-backend/http-backend.d.ts +8 -31
- package/types/services/template-request.d.ts +1 -9
- package/types/shared/jqlite/jqlite.d.ts +9 -9
- package/types/types.d.ts +5 -38
|
@@ -1,228 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
3
|
-
* @name ngShow
|
|
4
|
-
* @multiElement
|
|
5
|
-
*
|
|
6
|
-
* @description
|
|
7
|
-
* The `ngShow` directive shows or hides the given HTML element based on the expression provided to
|
|
8
|
-
* the `ngShow` attribute.
|
|
9
|
-
*
|
|
10
|
-
* The element is shown or hidden by removing or adding the `.ng-hide` CSS class onto the element.
|
|
11
|
-
* The `.ng-hide` CSS class is predefined in AngularJS and sets the display style to none (using an
|
|
12
|
-
* `!important` flag). For CSP mode please add `angular-csp.css` to your HTML file (see
|
|
13
|
-
* {@link ng.directive:ngCsp ngCsp}).
|
|
14
|
-
*
|
|
15
|
-
* ```html
|
|
16
|
-
* <!-- when $scope.myValue is truthy (element is visible) -->
|
|
17
|
-
* <div ng-show="myValue"></div>
|
|
18
|
-
*
|
|
19
|
-
* <!-- when $scope.myValue is falsy (element is hidden) -->
|
|
20
|
-
* <div ng-show="myValue" class="ng-hide"></div>
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* When the `ngShow` expression evaluates to a falsy value then the `.ng-hide` CSS class is added
|
|
24
|
-
* to the class attribute on the element causing it to become hidden. When truthy, the `.ng-hide`
|
|
25
|
-
* CSS class is removed from the element causing the element not to appear hidden.
|
|
26
|
-
*
|
|
27
|
-
* ## Why is `!important` used?
|
|
28
|
-
*
|
|
29
|
-
* You may be wondering why `!important` is used for the `.ng-hide` CSS class. This is because the
|
|
30
|
-
* `.ng-hide` selector can be easily overridden by heavier selectors. For example, something as
|
|
31
|
-
* simple as changing the display style on a HTML list item would make hidden elements appear
|
|
32
|
-
* visible. This also becomes a bigger issue when dealing with CSS frameworks.
|
|
33
|
-
*
|
|
34
|
-
* By using `!important`, the show and hide behavior will work as expected despite any clash between
|
|
35
|
-
* CSS selector specificity (when `!important` isn't used with any conflicting styles). If a
|
|
36
|
-
* developer chooses to override the styling to change how to hide an element then it is just a
|
|
37
|
-
* matter of using `!important` in their own CSS code.
|
|
38
|
-
*
|
|
39
|
-
* ### Overriding `.ng-hide`
|
|
40
|
-
*
|
|
41
|
-
* By default, the `.ng-hide` class will style the element with `display: none !important`. If you
|
|
42
|
-
* wish to change the hide behavior with `ngShow`/`ngHide`, you can simply overwrite the styles for
|
|
43
|
-
* the `.ng-hide` CSS class. Note that the selector that needs to be used is actually
|
|
44
|
-
* `.ng-hide:not(.ng-hide-animate)` to cope with extra animation classes that can be added.
|
|
45
|
-
*
|
|
46
|
-
* ```css
|
|
47
|
-
* .ng-hide:not(.ng-hide-animate) {
|
|
48
|
-
* /* These are just alternative ways of hiding an element */
|
|
49
|
-
* display: block!important;
|
|
50
|
-
* position: absolute;
|
|
51
|
-
* top: -9999px;
|
|
52
|
-
* left: -9999px;
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* By default you don't need to override anything in CSS and the animations will work around the
|
|
57
|
-
* display style.
|
|
58
|
-
*
|
|
59
|
-
* @animations
|
|
60
|
-
* | Animation | Occurs |
|
|
61
|
-
* |-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------|
|
|
62
|
-
* | {@link $animate#addClass addClass} `.ng-hide` | After the `ngShow` expression evaluates to a non truthy value and just before the contents are set to hidden. |
|
|
63
|
-
* | {@link $animate#removeClass removeClass} `.ng-hide` | After the `ngShow` expression evaluates to a truthy value and just before contents are set to visible. |
|
|
64
|
-
*
|
|
65
|
-
* Animations in `ngShow`/`ngHide` work with the show and hide events that are triggered when the
|
|
66
|
-
* directive expression is true and false. This system works like the animation system present with
|
|
67
|
-
* `ngClass` except that you must also include the `!important` flag to override the display
|
|
68
|
-
* property so that the elements are not actually hidden during the animation.
|
|
69
|
-
*
|
|
70
|
-
* ```css
|
|
71
|
-
* /* A working example can be found at the bottom of this page. */
|
|
72
|
-
* .my-element.ng-hide-add, .my-element.ng-hide-remove {
|
|
73
|
-
* transition: all 0.5s linear;
|
|
74
|
-
* }
|
|
75
|
-
*
|
|
76
|
-
* .my-element.ng-hide-add { ... }
|
|
77
|
-
* .my-element.ng-hide-add.ng-hide-add-active { ... }
|
|
78
|
-
* .my-element.ng-hide-remove { ... }
|
|
79
|
-
* .my-element.ng-hide-remove.ng-hide-remove-active { ... }
|
|
80
|
-
* ```
|
|
81
|
-
*
|
|
82
|
-
* Keep in mind that, as of AngularJS version 1.3, there is no need to change the display property
|
|
83
|
-
* to block during animation states - ngAnimate will automatically handle the style toggling for you.
|
|
84
|
-
*
|
|
85
|
-
* @element ANY
|
|
86
|
-
* @param {string} ngShow If the {@link guide/expression expression} is truthy/falsy then the
|
|
87
|
-
* element is shown/hidden respectively.
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* A simple example, animating the element's opacity:
|
|
91
|
-
|
|
92
|
-
* <hr />
|
|
93
|
-
*
|
|
94
|
-
* @knownIssue
|
|
95
|
-
*
|
|
96
|
-
* ### Flickering when using ngShow to toggle between elements
|
|
97
|
-
*
|
|
98
|
-
* When using {@link ngShow} and / or {@link ngHide} to toggle between elements, it can
|
|
99
|
-
* happen that both the element to show and the element to hide are visible for a very short time.
|
|
100
|
-
*
|
|
101
|
-
* This usually happens when the {@link ngAnimate ngAnimate module} is included, but no actual animations
|
|
102
|
-
* are defined for {@link ngShow} / {@link ngHide}.
|
|
103
|
-
*
|
|
104
|
-
* There are several way to mitigate this problem:
|
|
105
|
-
*
|
|
106
|
-
* - {@link guide/animations#how-to-selectively-enable-disable-and-skip-animations Disable animations on the affected elements}.
|
|
107
|
-
* - Use {@link ngIf} or {@link ngSwitch} instead of {@link ngShow} / {@link ngHide}.
|
|
108
|
-
* - Use the special CSS selector `ng-hide.ng-hide-animate` to set `{display: none}` or similar on the affected elements.
|
|
109
|
-
* - Use `ng-class="{'ng-hide': expression}` instead of instead of {@link ngShow} / {@link ngHide}.
|
|
110
|
-
* - Define an animation on the affected elements.
|
|
2
|
+
* @returns {import('../../types').Directive}
|
|
111
3
|
*/
|
|
112
|
-
export
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}))[];
|
|
4
|
+
export function ngShowDirective($animate: any): import("../../types").Directive;
|
|
5
|
+
export namespace ngShowDirective {
|
|
6
|
+
let $inject: string[];
|
|
7
|
+
}
|
|
117
8
|
/**
|
|
118
|
-
* @
|
|
119
|
-
* @name ngHide
|
|
120
|
-
* @multiElement
|
|
121
|
-
*
|
|
122
|
-
* @description
|
|
123
|
-
* The `ngHide` directive shows or hides the given HTML element based on the expression provided to
|
|
124
|
-
* the `ngHide` attribute.
|
|
125
|
-
*
|
|
126
|
-
* The element is shown or hidden by removing or adding the `.ng-hide` CSS class onto the element.
|
|
127
|
-
* The `.ng-hide` CSS class is predefined in AngularJS and sets the display style to none (using an
|
|
128
|
-
* `!important` flag). For CSP mode please add `angular-csp.css` to your HTML file (see
|
|
129
|
-
* {@link ng.directive:ngCsp ngCsp}).
|
|
130
|
-
*
|
|
131
|
-
* ```html
|
|
132
|
-
* <!-- when $scope.myValue is truthy (element is hidden) -->
|
|
133
|
-
* <div ng-hide="myValue" class="ng-hide"></div>
|
|
134
|
-
*
|
|
135
|
-
* <!-- when $scope.myValue is falsy (element is visible) -->
|
|
136
|
-
* <div ng-hide="myValue"></div>
|
|
137
|
-
* ```
|
|
138
|
-
*
|
|
139
|
-
* When the `ngHide` expression evaluates to a truthy value then the `.ng-hide` CSS class is added
|
|
140
|
-
* to the class attribute on the element causing it to become hidden. When falsy, the `.ng-hide`
|
|
141
|
-
* CSS class is removed from the element causing the element not to appear hidden.
|
|
142
|
-
*
|
|
143
|
-
* ## Why is `!important` used?
|
|
144
|
-
*
|
|
145
|
-
* You may be wondering why `!important` is used for the `.ng-hide` CSS class. This is because the
|
|
146
|
-
* `.ng-hide` selector can be easily overridden by heavier selectors. For example, something as
|
|
147
|
-
* simple as changing the display style on a HTML list item would make hidden elements appear
|
|
148
|
-
* visible. This also becomes a bigger issue when dealing with CSS frameworks.
|
|
149
|
-
*
|
|
150
|
-
* By using `!important`, the show and hide behavior will work as expected despite any clash between
|
|
151
|
-
* CSS selector specificity (when `!important` isn't used with any conflicting styles). If a
|
|
152
|
-
* developer chooses to override the styling to change how to hide an element then it is just a
|
|
153
|
-
* matter of using `!important` in their own CSS code.
|
|
154
|
-
*
|
|
155
|
-
* ### Overriding `.ng-hide`
|
|
156
|
-
*
|
|
157
|
-
* By default, the `.ng-hide` class will style the element with `display: none !important`. If you
|
|
158
|
-
* wish to change the hide behavior with `ngShow`/`ngHide`, you can simply overwrite the styles for
|
|
159
|
-
* the `.ng-hide` CSS class. Note that the selector that needs to be used is actually
|
|
160
|
-
* `.ng-hide:not(.ng-hide-animate)` to cope with extra animation classes that can be added.
|
|
161
|
-
*
|
|
162
|
-
* ```css
|
|
163
|
-
* .ng-hide:not(.ng-hide-animate) {
|
|
164
|
-
* /* These are just alternative ways of hiding an element */
|
|
165
|
-
* display: block!important;
|
|
166
|
-
* position: absolute;
|
|
167
|
-
* top: -9999px;
|
|
168
|
-
* left: -9999px;
|
|
169
|
-
* }
|
|
170
|
-
* ```
|
|
171
|
-
*
|
|
172
|
-
* By default you don't need to override in CSS anything and the animations will work around the
|
|
173
|
-
* display style.
|
|
174
|
-
*
|
|
175
|
-
* @animations
|
|
176
|
-
* | Animation | Occurs |
|
|
177
|
-
* |-----------------------------------------------------|------------------------------------------------------------------------------------------------------------|
|
|
178
|
-
* | {@link $animate#addClass addClass} `.ng-hide` | After the `ngHide` expression evaluates to a truthy value and just before the contents are set to hidden. |
|
|
179
|
-
* | {@link $animate#removeClass removeClass} `.ng-hide` | After the `ngHide` expression evaluates to a non truthy value and just before contents are set to visible. |
|
|
180
|
-
*
|
|
181
|
-
* Animations in `ngShow`/`ngHide` work with the show and hide events that are triggered when the
|
|
182
|
-
* directive expression is true and false. This system works like the animation system present with
|
|
183
|
-
* `ngClass` except that you must also include the `!important` flag to override the display
|
|
184
|
-
* property so that the elements are not actually hidden during the animation.
|
|
185
|
-
*
|
|
186
|
-
* ```css
|
|
187
|
-
* /* A working example can be found at the bottom of this page. */
|
|
188
|
-
* .my-element.ng-hide-add, .my-element.ng-hide-remove {
|
|
189
|
-
* transition: all 0.5s linear;
|
|
190
|
-
* }
|
|
191
|
-
*
|
|
192
|
-
* .my-element.ng-hide-add { ... }
|
|
193
|
-
* .my-element.ng-hide-add.ng-hide-add-active { ... }
|
|
194
|
-
* .my-element.ng-hide-remove { ... }
|
|
195
|
-
* .my-element.ng-hide-remove.ng-hide-remove-active { ... }
|
|
196
|
-
* ```
|
|
197
|
-
*
|
|
198
|
-
* Keep in mind that, as of AngularJS version 1.3, there is no need to change the display property
|
|
199
|
-
* to block during animation states - ngAnimate will automatically handle the style toggling for you.
|
|
200
|
-
*
|
|
201
|
-
* @element ANY
|
|
202
|
-
* @param {string} ngHide If the {@link guide/expression expression} is truthy/falsy then the
|
|
203
|
-
* element is hidden/shown respectively.
|
|
204
|
-
*
|
|
205
|
-
* @knownIssue
|
|
206
|
-
*
|
|
207
|
-
* ### Flickering when using ngHide to toggle between elements
|
|
208
|
-
*
|
|
209
|
-
* When using {@link ngShow} and / or {@link ngHide} to toggle between elements, it can
|
|
210
|
-
* happen that both the element to show and the element to hide are visible for a very short time.
|
|
211
|
-
*
|
|
212
|
-
* This usually happens when the {@link ngAnimate ngAnimate module} is included, but no actual animations
|
|
213
|
-
* are defined for {@link ngShow} / {@link ngHide}. Internet Explorer is affected more often than
|
|
214
|
-
* other browsers.
|
|
215
|
-
*
|
|
216
|
-
* There are several way to mitigate this problem:
|
|
217
|
-
*
|
|
218
|
-
* - {@link guide/animations#how-to-selectively-enable-disable-and-skip-animations Disable animations on the affected elements}.
|
|
219
|
-
* - Use {@link ngIf} or {@link ngSwitch} instead of {@link ngShow} / {@link ngHide}.
|
|
220
|
-
* - Use the special CSS selector `ng-hide.ng-hide-animate` to set `{display: none}` or similar on the affected elements.
|
|
221
|
-
* - Use `ng-class="{'ng-hide': expression}` instead of instead of {@link ngShow} / {@link ngHide}.
|
|
222
|
-
* - Define an animation on the affected elements.
|
|
9
|
+
* @returns {import('../../types').Directive}
|
|
223
10
|
*/
|
|
224
|
-
export
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
11
|
+
export function ngHideDirective($animate: any): import("../../types").Directive;
|
|
12
|
+
export namespace ngHideDirective {
|
|
13
|
+
let $inject_1: string[];
|
|
14
|
+
export { $inject_1 as $inject };
|
|
15
|
+
}
|
package/types/loader.d.ts
CHANGED
|
@@ -79,9 +79,9 @@ export class Angular {
|
|
|
79
79
|
*
|
|
80
80
|
* @param {any[]} modules
|
|
81
81
|
* @param {boolean?} strictDi
|
|
82
|
-
* @returns {import("./
|
|
82
|
+
* @returns {import("./core/di/internal-injector").InjectorService}
|
|
83
83
|
*/
|
|
84
|
-
injector(modules: any[], strictDi: boolean | null): import("./
|
|
84
|
+
injector(modules: any[], strictDi: boolean | null): import("./core/di/internal-injector").InjectorService;
|
|
85
85
|
/**
|
|
86
86
|
* @param {Element|Document} element
|
|
87
87
|
*/
|
|
@@ -129,11 +129,11 @@ export class Angular {
|
|
|
129
129
|
* @param {string} name The name of the module to create or retrieve.
|
|
130
130
|
* @param {Array.<string>} [requires] If specified then new module is being created. If
|
|
131
131
|
* unspecified then the module is being retrieved for further configuration.
|
|
132
|
-
* @param {Function} [configFn] Optional configuration function for the module. Same as
|
|
132
|
+
* @param {Array<any>|Function} [configFn] Optional configuration function for the module. Same as
|
|
133
133
|
* {@link import('./types').Module#config Module#config()}.
|
|
134
134
|
* @returns {NgModule} A newly registered module.
|
|
135
135
|
*/
|
|
136
|
-
module(name: string, requires?: Array<string>, configFn?: Function): NgModule;
|
|
136
|
+
module(name: string, requires?: Array<string>, configFn?: Array<any> | Function): NgModule;
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
139
|
* Configuration option for AngularTS bootstrap process.
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {import("../core/di/internal-injector").InjectorService} $injector
|
|
4
|
+
* @param {*} $q
|
|
5
|
+
* @param {*} $stateRegistry
|
|
6
|
+
* @param {*} $urlService
|
|
7
|
+
*/
|
|
8
|
+
export function runBlock($injector: import("../core/di/internal-injector").InjectorService, $q: any, $stateRegistry: any, $urlService: any): void;
|
|
2
9
|
export namespace runBlock {
|
|
3
10
|
let $inject: string[];
|
|
4
11
|
}
|
|
@@ -57,7 +57,7 @@ export class StateBuilder {
|
|
|
57
57
|
matcher: any;
|
|
58
58
|
$injector: any;
|
|
59
59
|
builders: {
|
|
60
|
-
name: (
|
|
60
|
+
name: ((state: any) => any)[];
|
|
61
61
|
self: (typeof selfBuilder)[];
|
|
62
62
|
parent: ((state: any) => any)[];
|
|
63
63
|
data: (typeof dataBuilder)[];
|
|
@@ -81,7 +81,6 @@ export class StateBuilder {
|
|
|
81
81
|
parentName(state: any): any;
|
|
82
82
|
name(state: any): any;
|
|
83
83
|
}
|
|
84
|
-
declare function nameBuilder(state: any): any;
|
|
85
84
|
declare function selfBuilder(state: any): any;
|
|
86
85
|
declare function dataBuilder(state: any): any;
|
|
87
86
|
declare function pathBuilder(state: any): any;
|
|
@@ -9,12 +9,12 @@ export class StateRegistry {
|
|
|
9
9
|
states: {};
|
|
10
10
|
urlService: any;
|
|
11
11
|
urlServiceRules: any;
|
|
12
|
-
$injector:
|
|
12
|
+
$injector: import("../../core/di/internal-injector").InjectorService;
|
|
13
13
|
listeners: any[];
|
|
14
14
|
matcher: StateMatcher;
|
|
15
15
|
builder: StateBuilder;
|
|
16
16
|
stateQueue: StateQueueManager;
|
|
17
|
-
$get: (string | (($injector:
|
|
17
|
+
$get: (string | (($injector: import("../../core/di/internal-injector").InjectorService) => this))[];
|
|
18
18
|
/**
|
|
19
19
|
* This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,
|
|
20
20
|
* `onRetain` callback hooks on a [[Ng1StateDeclaration]].
|
|
@@ -123,9 +123,9 @@ export class StateService {
|
|
|
123
123
|
decorator(name: string, func: object): object;
|
|
124
124
|
/**
|
|
125
125
|
*
|
|
126
|
-
* @param {
|
|
126
|
+
* @param {any} definition
|
|
127
127
|
*/
|
|
128
|
-
state(definition:
|
|
128
|
+
state(definition: any): this;
|
|
129
129
|
/**
|
|
130
130
|
* Handler for when [[transitionTo]] is called with an invalid state.
|
|
131
131
|
*
|
|
@@ -110,10 +110,10 @@ export class StateProvider {
|
|
|
110
110
|
decorator(name: string, func: object): object;
|
|
111
111
|
/**
|
|
112
112
|
*
|
|
113
|
-
* @param {
|
|
113
|
+
* @param {*} definition
|
|
114
114
|
* @returns {StateProvider}
|
|
115
115
|
*/
|
|
116
|
-
state(definition:
|
|
116
|
+
state(definition: any): StateProvider;
|
|
117
117
|
/**
|
|
118
118
|
* Registers an invalid state handler
|
|
119
119
|
*
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
export class TemplateFactory {
|
|
10
10
|
/** @type {boolean} */
|
|
11
11
|
_useHttp: boolean;
|
|
12
|
-
$get: (string | (($http:
|
|
13
|
-
$templateRequest:
|
|
14
|
-
$http:
|
|
15
|
-
$templateCache:
|
|
16
|
-
$q:
|
|
17
|
-
$injector:
|
|
12
|
+
$get: (string | (($http: any, $templateCache: any, $templateRequest: any, $q: any, $injector: import("../core/di/internal-injector").InjectorService) => this))[];
|
|
13
|
+
$templateRequest: any;
|
|
14
|
+
$http: any;
|
|
15
|
+
$templateCache: any;
|
|
16
|
+
$q: any;
|
|
17
|
+
$injector: import("../core/di/internal-injector").InjectorService;
|
|
18
18
|
/**
|
|
19
19
|
* Forces the provider to use $http service directly
|
|
20
20
|
* @param {boolean} value
|
|
@@ -27,24 +27,24 @@ export class TemplateFactory {
|
|
|
27
27
|
* The following properties are search in the specified order, and the first one
|
|
28
28
|
* that is defined is used to create the template:
|
|
29
29
|
*
|
|
30
|
-
* @param {
|
|
30
|
+
* @param {any} config
|
|
31
31
|
* @param {any} params Parameters to pass to the template function.
|
|
32
|
-
* @param {
|
|
32
|
+
* @param {import("./resolve/resolve-context").ResolveContext} context The resolve context associated with the template's view
|
|
33
33
|
*
|
|
34
34
|
* @return {string|object} The template html as a string, or a promise for
|
|
35
35
|
* that string,or `null` if no template is configured.
|
|
36
36
|
*/
|
|
37
|
-
fromConfig(config:
|
|
37
|
+
fromConfig(config: any, params: any, context: import("./resolve/resolve-context").ResolveContext): string | object;
|
|
38
38
|
/**
|
|
39
39
|
* Creates a template from a string or a function returning a string.
|
|
40
40
|
*
|
|
41
41
|
* @param {string | Function} template html template as a string or function that returns an html template as a string.
|
|
42
|
-
* @param {
|
|
42
|
+
* @param {any} [params] Parameters to pass to the template function.
|
|
43
43
|
*
|
|
44
44
|
* @return {string|object} The template html as a string, or a promise for that
|
|
45
45
|
* string.
|
|
46
46
|
*/
|
|
47
|
-
fromString(template: string | Function, params?:
|
|
47
|
+
fromString(template: string | Function, params?: any): string | object;
|
|
48
48
|
/**
|
|
49
49
|
* Loads a template from the a URL via `$http` and `$templateCache`.
|
|
50
50
|
*
|
|
@@ -60,11 +60,11 @@ export class TemplateFactory {
|
|
|
60
60
|
*
|
|
61
61
|
* @param {import('../types').Injectable<any>} provider Function to invoke via `locals`
|
|
62
62
|
* @param {Function} injectFn a function used to invoke the template provider
|
|
63
|
-
* @param {
|
|
63
|
+
* @param {import("./resolve/resolve-context").ResolveContext} context
|
|
64
64
|
* @return {string|Promise.<string>} The template html as a string, or a promise
|
|
65
65
|
* for that string.
|
|
66
66
|
*/
|
|
67
|
-
fromProvider(provider: import("../types").Injectable<any>, params: any, context:
|
|
67
|
+
fromProvider(provider: import("../types").Injectable<any>, params: any, context: import("./resolve/resolve-context").ResolveContext): string | Promise<string>;
|
|
68
68
|
/**
|
|
69
69
|
* Creates a component's template by invoking an injectable provider function.
|
|
70
70
|
*
|
|
@@ -81,13 +81,13 @@ export class TemplateFactory {
|
|
|
81
81
|
* It analyses the component's bindings, then constructs a template that instantiates the component.
|
|
82
82
|
* The template wires input and output bindings to resolves or from the parent component.
|
|
83
83
|
*
|
|
84
|
-
* @param {
|
|
85
|
-
* @param {
|
|
84
|
+
* @param {any} ngView {object} The parent ui-view (for binding outputs to callbacks)
|
|
85
|
+
* @param {import("./resolve/resolve-context").ResolveContext} context The ResolveContext (for binding outputs to callbacks returned from resolves)
|
|
86
86
|
* @param {string} component {string} Component's name in camel case.
|
|
87
87
|
* @param {any} [bindings] An object defining the component's bindings: {foo: '<'}
|
|
88
88
|
* @return {string} The template as a string: "<component-name input1='::$resolve.foo'></component-name>".
|
|
89
89
|
*/
|
|
90
|
-
makeComponentTemplate(ngView:
|
|
90
|
+
makeComponentTemplate(ngView: any, context: import("./resolve/resolve-context").ResolveContext, component: string, bindings?: any): string;
|
|
91
91
|
}
|
|
92
92
|
export type BindingTuple = {
|
|
93
93
|
name: string;
|
|
@@ -104,15 +104,15 @@ export class UrlService {
|
|
|
104
104
|
* locationServices.url("/some/path?query=value#anchor", true);
|
|
105
105
|
* ```
|
|
106
106
|
*
|
|
107
|
-
* @param {string} newUrl The new value for the URL.
|
|
107
|
+
* @param {string} [newUrl] The new value for the URL.
|
|
108
108
|
* This url should reflect only the new internal [[path]], [[search]], and [[hash]] values.
|
|
109
109
|
* It should not include the protocol, site, port, or base path of an absolute HREF.
|
|
110
|
-
* @param {boolean} replace When true, replaces the current history entry (instead of appending it) with this new url
|
|
111
|
-
* @param {any} state The history's state object, i.e., pushState (if the LocationServices implementation supports it)
|
|
110
|
+
* @param {boolean} [replace] When true, replaces the current history entry (instead of appending it) with this new url
|
|
111
|
+
* @param {any} [state] The history's state object, i.e., pushState (if the LocationServices implementation supports it)
|
|
112
112
|
*
|
|
113
113
|
* @return the url (after potentially being processed)
|
|
114
114
|
*/
|
|
115
|
-
url(newUrl
|
|
115
|
+
url(newUrl?: string, replace?: boolean, state?: any): any;
|
|
116
116
|
/**
|
|
117
117
|
* @internal
|
|
118
118
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function AnchorScrollProvider(): void;
|
|
2
2
|
export class AnchorScrollProvider {
|
|
3
3
|
disableAutoScrolling: () => void;
|
|
4
|
-
$get: (string | (($location:
|
|
4
|
+
$get: (string | (($location: any, $rootScope: import("../core/scope/scope").Scope) => (hash: any) => void))[];
|
|
5
5
|
}
|
|
@@ -149,8 +149,6 @@ export class Browser {
|
|
|
149
149
|
cancel: (deferId: number) => boolean;
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
|
-
* @typedef {import('../types').ServiceProvider} angular.BrowserProvider
|
|
153
|
-
* @description
|
|
154
152
|
* This object has two goals:
|
|
155
153
|
*
|
|
156
154
|
* - hide all the global state in the browser caused by the window object
|
|
@@ -158,15 +156,7 @@ export class Browser {
|
|
|
158
156
|
*
|
|
159
157
|
* Remove this in the future
|
|
160
158
|
*/
|
|
161
|
-
/**
|
|
162
|
-
* @constructor
|
|
163
|
-
* @this {angular.BrowserProvider}
|
|
164
|
-
*/
|
|
165
|
-
export function BrowserProvider(this: import("../types").ServiceProvider): void;
|
|
166
159
|
export class BrowserProvider {
|
|
167
160
|
$get: (string | (($$taskTrackerFactory: import("../core/task-tracker-factory").TaskTracker) => Browser))[];
|
|
168
161
|
}
|
|
169
162
|
export type UrlChangeListener = (arg0: string, arg1: string | null) => any;
|
|
170
|
-
export namespace angular {
|
|
171
|
-
type BrowserProvider = import("../types").ServiceProvider;
|
|
172
|
-
}
|
|
@@ -1,70 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @ngdoc service
|
|
3
|
-
* @name $cacheFactory
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @description
|
|
7
|
-
* Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to
|
|
8
|
-
* them.
|
|
9
|
-
*
|
|
10
|
-
* ```js
|
|
11
|
-
*
|
|
12
|
-
* let cache = $cacheFactory('cacheId');
|
|
13
|
-
* expect($cacheFactory.get('cacheId')).toBe(cache);
|
|
14
|
-
* expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();
|
|
15
|
-
*
|
|
16
|
-
* cache.put("key", "value");
|
|
17
|
-
* cache.put("another key", "another value");
|
|
18
|
-
*
|
|
19
|
-
* // We've specified no options on creation
|
|
20
|
-
* expect(cache.info()).toEqual({id: 'cacheId', size: 2});
|
|
21
|
-
*
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
<example module="cacheExampleApp" name="cache-factory">
|
|
27
|
-
<file name="index.html">
|
|
28
|
-
<div ng-controller="CacheController">
|
|
29
|
-
<input ng-model="newCacheKey" placeholder="Key">
|
|
30
|
-
<input ng-model="newCacheValue" placeholder="Value">
|
|
31
|
-
<button ng-click="put(newCacheKey, newCacheValue)">Cache</button>
|
|
32
|
-
|
|
33
|
-
<p ng-if="keys.length">Cached Values</p>
|
|
34
|
-
<div ng-repeat="key in keys">
|
|
35
|
-
<span ng-bind="key"></span>
|
|
36
|
-
<span>: </span>
|
|
37
|
-
<b ng-bind="cache.get(key)"></b>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<p>Cache Info</p>
|
|
41
|
-
<div ng-repeat="(key, value) in cache.info()">
|
|
42
|
-
<span ng-bind="key"></span>
|
|
43
|
-
<span>: </span>
|
|
44
|
-
<b ng-bind="value"></b>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</file>
|
|
48
|
-
<file name="script.js">
|
|
49
|
-
angular.module('cacheExampleApp', []).
|
|
50
|
-
controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {
|
|
51
|
-
$scope.keys = [];
|
|
52
|
-
$scope.cache = $cacheFactory('cacheId');
|
|
53
|
-
$scope.put = function(key, value) {
|
|
54
|
-
if (angular.isUndefined($scope.cache.get(key))) {
|
|
55
|
-
$scope.keys.push(key);
|
|
56
|
-
}
|
|
57
|
-
$scope.cache.put(key, angular.isUndefined(value) ? null : value);
|
|
58
|
-
};
|
|
59
|
-
}]);
|
|
60
|
-
</file>
|
|
61
|
-
<file name="style.css">
|
|
62
|
-
p {
|
|
63
|
-
margin: 10px 0 3px;
|
|
64
|
-
}
|
|
65
|
-
</file>
|
|
66
|
-
</example>
|
|
67
|
-
*/
|
|
68
1
|
export function CacheFactoryProvider(): void;
|
|
69
2
|
export class CacheFactoryProvider {
|
|
70
3
|
$get: () => {
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @description
|
|
4
|
-
* This is a private service for reading cookies used by $http and ngCookies
|
|
5
|
-
*
|
|
6
|
-
* @return {Object} a key/value map of the current cookies
|
|
2
|
+
* @returns {Object<String, String>} List of all cookies
|
|
7
3
|
*/
|
|
8
|
-
export function
|
|
9
|
-
export function CookieReaderProvider(): void;
|
|
10
|
-
export class CookieReaderProvider {
|
|
11
|
-
$get: typeof $$CookieReader;
|
|
12
|
-
}
|
|
4
|
+
export function getCookies(): any;
|