Module ‘angular-data.DSCacheFactory’ is not available!

https://forum.ionicframework.com/t/module-angular-data-dscachefactory-is-not-available/21387

 

I am injecting a angular-cache module in my app! But I am getting this error.

Uncaught Error: [$injector:modulerr] Failed to instantiate module sociogram due to:
Error: [$injector:modulerr] Failed to instantiate module angular-data.DSCacheFactory due to:
Error: [$injector:nomod] Module 'angular-data.DSCacheFactory' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.3.13/$injector/nomod?p0=angular-data.DSCacheFactory
at REGEX_STRING_REGEXP (http://localhost:8100/lib/ionic/js/ionic.bundle.js:8755:12)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:10459:17
at ensure (http://localhost:8100/lib/ionic/js/ionic.bundle.js:10383:38)
at module (http://localhost:8100/lib/ionic/js/ionic.bundle.js:10457:14)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:12789:22
at forEach (http://localhost:8100/lib/ionic/js/ionic.bundle.js:9015:20)
at loadModules (http://localhost:8100/lib/ionic/js/ionic.bundle.js:12773:5)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:12790:40
at forEach (http://localhost:8100/lib/ionic/js/ionic.bundle.js:9015:20)
at loadModules (http://localhost:8100/lib/ionic/js/ionic.bundle.js:12773:5)
http://errors.angularjs.org/1.3.13/$injector/modulerr?p0=angular-data.DSCac…%3A%2F%2Flocalhost%3A8100%2Flib%2Fionic%2Fjs%2Fionic.bundle.js%3A12773%3A5)
at REGEX_STRING_REGEXP (http://localhost:8100/lib/ionic/js/ionic.bundle.js:8755:12)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:12812:15
at forEach (http://localhost:8100/lib/ionic/js/ionic.bundle.js:9015:20)
at loadModules (http://localhost:8100/lib/ionic/js/ionic.bundle.js:12773:5)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:12790:40
at forEach (http://localhost:8100/lib/ionic/js/ionic.bundle.js:9015:20)
at loadModules (http://localhost:8100/lib/ionic/js/ionic.bundle.js:12773:5)
at createInjector (http://localhost:8100/lib/ionic/js/ionic.bundle.js:12699:11)
at doBootstrap (http://localhost:8100/lib/ionic/js/ionic.bundle.js:10137:20)
at bootstrap (http://localhost:8100/lib/ionic/js/ionic.bundle.js:10158:12)
http://errors.angularjs.org/1.3.13/$injector/modulerr?p0=sociogram&p1=Error…3A%2F%2Flocalhost%3A8100%2Flib%2Fionic%2Fjs%2Fionic.bundle.js%3A10158%3A12)

This is my code where i am injecting the module in my app:
index.html:

http://lib/ionic/js/ionic.bundle.js
http://lib/angular-cache/dist/angular-cache.min.js
http://js/ng-cordova.min.js
http://cordova.js

http://js/app.js
http://js/openfb-angular.js
http://js/controllers.js

app.js:

angular.module('sociogram', ['ionic','angular-data.DSCacheFactory', 'openfb', 'sociogram.controllers','ngCordova'])

    .run(function ($rootScope,DSCacheFactory, $state, $ionicPlatform, $window, OpenFB) {

        OpenFB.init('app_id','http://localhost:8100/oauthcallback.html');

        $ionicPlatform.ready(function () {
            if (window.StatusBar) {
                StatusBar.styleDefault();
            }
        });

        DSCacheFactory("leagueDataCache",{ storageMode: "localStorage", maxAge:10000, deleteOnExpire: "aggressive"});
        DSCacheFactory("leaguesCache",{ storageMode: "localStorage", maxAge:10000, deleteOnExpire: "aggressive"});
        DSCacheFactory("MyTeamsCache",{ storageMode: "localStorage"});
        DSCacheFactory("staticCache",{ storageMode: "localStorage"});

        $rootScope.$on('$stateChangeStart', function(event, toState) {
            if (toState.name !== "app.login" && toState.name !== "app.logout" && !$window.sessionStorage['fbtoken']) {
                $state.go('app.login');
                event.preventDefault();
            }
        });

        $rootScope.$on('OAuthException', function() {
            $state.go('app.login');
        });

    });

Please help! What is wrong with this code?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s