Skip to content

Commit

Permalink
Rename 'store' service to 'ngCartStore'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rooke committed Mar 29, 2015
1 parent 4aa9727 commit 670b7fd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions dist/ngCart.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ angular.module('ngCart', ['ngCart.directives'])
};
})

.run(['$rootScope', 'ngCart','ngCartItem', 'store', function ($rootScope, ngCart, ngCartItem, store) {
.run(['$rootScope', 'ngCart','ngCartItem', 'ngCartStore', function ($rootScope, ngCart, ngCartItem, ngCartStore) {

$rootScope.$on('ngCart:change', function(){
ngCart.$save();
});

if (angular.isObject(store.get('cart'))) {
ngCart.$restore(store.get('cart'));
if (angular.isObject(ngCartStore.get('cart'))) {
ngCart.$restore(ngCartStore.get('cart'));

} else {
ngCart.init();
}

}])

.service('ngCart', ['$rootScope', 'ngCartItem', 'store', function ($rootScope, ngCartItem, store) {
.service('ngCart', ['$rootScope', 'ngCartItem', 'ngCartStore', function ($rootScope, ngCartItem, ngCartStore) {

this.init = function(){
this.$cart = {
Expand Down Expand Up @@ -186,7 +186,7 @@ angular.module('ngCart', ['ngCart.directives'])
};

this.$save = function () {
return store.set('cart', JSON.stringify(this.getCart()));
return ngCartStore.set('cart', JSON.stringify(this.getCart()));
}

}])
Expand Down Expand Up @@ -294,7 +294,7 @@ angular.module('ngCart', ['ngCart.directives'])

}])

.service('store', ['$window', function ($window) {
.service('ngCartStore', ['$window', function ($window) {

return {

Expand Down
2 changes: 1 addition & 1 deletion dist/ngCart.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/ngCart.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ angular.module('ngCart', ['ngCart.directives'])
};
})

.run(['$rootScope', 'ngCart','ngCartItem', 'store', function ($rootScope, ngCart, ngCartItem, store) {
.run(['$rootScope', 'ngCart','ngCartItem', 'ngCartStore', function ($rootScope, ngCart, ngCartItem, ngCartStore) {

$rootScope.$on('ngCart:change', function(){
ngCart.$save();
});

if (angular.isObject(store.get('cart'))) {
ngCart.$restore(store.get('cart'));
if (angular.isObject(ngCartStore.get('cart'))) {
ngCart.$restore(ngCartStore.get('cart'));

} else {
ngCart.init();
}

}])

.service('ngCart', ['$rootScope', 'ngCartItem', 'store', function ($rootScope, ngCartItem, store) {
.service('ngCart', ['$rootScope', 'ngCartItem', 'ngCartStore', function ($rootScope, ngCartItem, ngCartStore) {

this.init = function(){
this.$cart = {
Expand Down Expand Up @@ -186,7 +186,7 @@ angular.module('ngCart', ['ngCart.directives'])
};

this.$save = function () {
return store.set('cart', JSON.stringify(this.getCart()));
return ngCartStore.set('cart', JSON.stringify(this.getCart()));
}

}])
Expand Down Expand Up @@ -294,7 +294,7 @@ angular.module('ngCart', ['ngCart.directives'])

}])

.service('store', ['$window', function ($window) {
.service('ngCartStore', ['$window', function ($window) {

return {

Expand Down

0 comments on commit 670b7fd

Please sign in to comment.