Skip to content

Commit

Permalink
Remove required CacheFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
orloffv committed Jul 21, 2016
1 parent 9407729 commit 59a69e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions dist/staffim-form.js
Expand Up @@ -521,8 +521,8 @@
angular.module('staffimForm')
.factory('SFService', SFService);

SFService.$inject = ['SUNotify', '$q', '$timeout', 'CacheFactory', 'CONFIG'];
function SFService(SUNotify, $q, $timeout, CacheFactory, CONFIG) {
SFService.$inject = ['SUNotify', '$q', '$timeout', '$injector', 'CONFIG'];
function SFService(SUNotify, $q, $timeout, $injector, CONFIG) {
/* jshint validthis: true */
var service = function() {
this.formOptions = {};
Expand Down Expand Up @@ -603,6 +603,7 @@
service.prototype.saveOffline = saveOffline;

function getBackupCache() {
var CacheFactory = $injector.get('CacheFactory');
if (!CacheFactory.get('formCache')) {
CacheFactory.createCache('formCache', {
storageMode: 'localStorage',
Expand Down
5 changes: 3 additions & 2 deletions src/scripts/staffimForm.service.js
Expand Up @@ -2,8 +2,8 @@
angular.module('staffimForm')
.factory('SFService', SFService);

SFService.$inject = ['SUNotify', '$q', '$timeout', 'CacheFactory', 'CONFIG'];
function SFService(SUNotify, $q, $timeout, CacheFactory, CONFIG) {
SFService.$inject = ['SUNotify', '$q', '$timeout', '$injector', 'CONFIG'];
function SFService(SUNotify, $q, $timeout, $injector, CONFIG) {
/* jshint validthis: true */
var service = function() {
this.formOptions = {};
Expand Down Expand Up @@ -84,6 +84,7 @@
service.prototype.saveOffline = saveOffline;

function getBackupCache() {
var CacheFactory = $injector.get('CacheFactory');
if (!CacheFactory.get('formCache')) {
CacheFactory.createCache('formCache', {
storageMode: 'localStorage',
Expand Down

0 comments on commit 59a69e2

Please sign in to comment.