Closed MFD3000 closed 9 years ago
Are you coding in ES6? How are you importing angular-cache into your projects?
No Im not using ES6.
Currently Im importing as simply as possible. Have angular-cache.js in libs folder. Loading the script in index.html.
In app.js config, I have injected 'angular-cache'. In my service, which is include in the apps module, I have CacheFactory injected in the function.
What version of angular-cache, angular, etc.?
angular v1.3.15
angular-cache 4.2
Here is the one line of code I have trying to access angular-cache right now. var profileCache = CacheFactory('profileCache');
Try adding CacheFactory as a dependency on your controller:
myControllers.controller('HomeController', ['$scope', '$http', '$routeParams', 'myCache', 'CacheFactory', function HomeController($scope, $http, $routeParams, myCache, CacheFactory) {
Should be fixed already, but should be definitely fixed in 4.2.1. See the build_examples.
Im assuming this is my own user error but after spinning my wheels, I figured id see if anyone is experiencing similar.
Im currently building a hybrid mobile app with ionic.js Im trying to incorporate angular-cache as Ive LOVED using the older version, angularCacheFactory, on a previous project.
However, any time I try and access CacheFactory in my services, its telling me that CacheFactory is undefined.
Ive checked and double checked that the lib is available and injected in app.js and my service properly. I get no errors until I try and use CacheFactory. Even then, I get no error. Im just told CacheFactory is undefined.
Anyone have experience with this issue?
Thanks in advance.