Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: DSBinaryHeap is not defined when trying to configure a simple sessionStorage based cache. #105

Closed
shyam-habarakada opened this issue Feb 25, 2014 · 8 comments
Labels

Comments

@shyam-habarakada
Copy link

ReferenceError: DSBinaryHeap is not defined
  at new DSCache (http://localhost:3001/assets/angular-cache/angular-cache.js?body=1:554:27)
  at DSCacheFactory (http://localhost:3001/assets/angular-cache/angular-cache.js?body=1:1741:22)
  at Object.<anonymous> (http://localhost:3001/assets/ng/services/session.js?body=1:7:22)

The code in question looks like

angular.module('app.services').factory('sessionService', [
  '$http', '$log', 'DSCacheFactory', function($http, $log, DSCacheFactory) {

    // ...

    sessionCache = DSCacheFactory('sessionCache', {
      storageMode: 'sessionStorage'
    });

    // ...
    return sessionService;
  }
]);

And my app.services module has a dependency on 'angular-data.DSCacheFactory'

@jmdobry
Copy link
Owner

jmdobry commented Feb 25, 2014

@shyam-habarakada Well, thanks for trying out the 3.0.0 beta. I'll take a look!

@jmdobry
Copy link
Owner

jmdobry commented Feb 25, 2014

@shyam-habarakada Should be fixed in 3.0.0-beta.2

@shyam-habarakada
Copy link
Author

Great, thanks. I will try it out. What's the general status of the beta? We're writing a new app and would like to just use 3.0 if core functionality is stable. We will mainly use session and memory caching (no local storage)

@jmdobry
Copy link
Owner

jmdobry commented Feb 25, 2014

@shyam-habarakada I'd like to say that core functionality is stable, but I just released the beta yesterday, so take my assertion of stability with a grain of salt. If however, you still just want to use start using 3.x.x, I am prepared to fix any new bugs as fast as possible.

@dbush3721
Copy link

angular.module('mmar', ['angular-data.DSCacheFactory' ...
...
.run(function ($angularCacheFactory) {
var myCache = $angularCacheFactory('myCache', {
storageMode: 'localStorage'
});
})

Uncaught Error: Unknown provider: $angularCacheFactoryProvider <- $angularCacheFactory

Using 3.0 I know $angularCacheFactory is probably incorrect but, I can't figure what it should be? Think its supposed to be DSCacheFactory?

Thanks,
Dan

@jmdobry
Copy link
Owner

jmdobry commented Apr 9, 2014

If you're on 3.x.x, change $angularCacheFactory to DSCacheFactory and it
will work

@dbush3721
Copy link

GcdService.$inject = ['$rootScope', '$q', 'DSCacheFactory', 'loginService', 'dummyLoginService','rulesFile', '$filter'];
function GcdService($rootScope, $q, DSCacheFactory, loginService, dummyLoginService,rulesFile, $filter) {

var gcdCache = DSCacheFactory('gcdCache', {
storageMode: 'localStorage'
});

...

Error: Unknown provider: $rootElementProvider <- $rootElement <- $location

@jmdobry
Copy link
Owner

jmdobry commented Apr 9, 2014

@dbush3721 DSCacheFactory does not depend on the $location service at all. One of those other dependencies must be the problem.

@jmdobry jmdobry added the bug label Sep 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants