6
6
*
7
7
* @description
8
8
* Factory that constructs cache objects and gives access to them.
9
- *
9
+ *
10
10
* ```js
11
- *
11
+ *
12
12
* var cache = $cacheFactory('cacheId');
13
13
* expect($cacheFactory.get('cacheId')).toBe(cache);
14
14
* expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();
17
17
* cache.put("another key", "another value");
18
18
*
19
19
* // We've specified no options on creation
20
- * expect(cache.info()).toEqual({id: 'cacheId', size: 2});
21
- *
20
+ * expect(cache.info()).toEqual({id: 'cacheId', size: 2});
21
+ *
22
22
* ```
23
23
*
24
24
*
@@ -199,7 +199,7 @@ function $CacheFactoryProvider() {
199
199
* The first time a template is used, it is loaded in the template cache for quick retrieval. You
200
200
* can load templates directly into the cache in a `script` tag, or by consuming the
201
201
* `$templateCache` service directly.
202
- *
202
+ *
203
203
* Adding via the `script` tag:
204
204
* ```html
205
205
* <html ng-app>
@@ -211,29 +211,29 @@ function $CacheFactoryProvider() {
211
211
* ...
212
212
* </html>
213
213
* ```
214
- *
214
+ *
215
215
* **Note:** the `script` tag containing the template does not need to be included in the `head` of
216
216
* the document, but it must be below the `ng-app` definition.
217
- *
217
+ *
218
218
* Adding via the $templateCache service:
219
- *
219
+ *
220
220
* ```js
221
221
* var myApp = angular.module('myApp', []);
222
222
* myApp.run(function($templateCache) {
223
223
* $templateCache.put('templateId.html', 'This is the content of the template');
224
224
* });
225
225
* ```
226
- *
226
+ *
227
227
* To retrieve the template later, simply use it in your HTML:
228
228
* ```html
229
229
* <div ng-include=" 'templateId.html' "></div>
230
230
* ```
231
- *
231
+ *
232
232
* or get it via Javascript:
233
233
* ```js
234
234
* $templateCache.get('templateId.html')
235
235
* ```
236
- *
236
+ *
237
237
* See {@link ng.$cacheFactory $cacheFactory}.
238
238
*
239
239
*/
0 commit comments