Skip to content

Commit f1dfdd2

Browse files
committed
Added missing $q service in angular-cache guide.
1 parent 19537b4 commit f1dfdd2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

guide/angular-cache/http.doc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ app.run(function ($http, DSCacheFactory) {
2020
$http.defaults.cache = DSCacheFactory.get('defaultCache');
2121
});
2222

23-
app.service('myService', function ($http) {
23+
app.service('myService', function ($http, $q) {
2424
return {
2525
getDataById: function (id) {
2626
var deferred = $q.defer(),
@@ -52,7 +52,7 @@ app.controller('myCtrl', function (myService) {
5252

5353
Tell `$http` to use a cache created by `DSCacheFactory` for a specific request:
5454
```javascript
55-
app.service('myService', function ($http, DSCacheFactory) {
55+
app.service('myService', function ($q, $http, DSCacheFactory) {
5656

5757
DSCacheFactory('dataCache', {
5858
maxAge: 90000, // Items added to this cache expire after 15 minutes.
@@ -91,7 +91,7 @@ app.controller('myCtrl', function (myService) {
9191

9292
Do your own caching while using the $http service:
9393
```javascript
94-
app.service('myService', function ($http, DSCacheFactory) {
94+
app.service('myService', function ($q, $http, DSCacheFactory) {
9595

9696
DSCacheFactory('dataCache', {
9797
maxAge: 900000, // Items added to this cache expire after 15 minutes.

0 commit comments

Comments
 (0)