@@ -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
5353Tell `$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
9292Do 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