Skip to content

Commit

Permalink
updates dist folder to reflect src changes
Browse files Browse the repository at this point in the history
  • Loading branch information
amejiarosario committed Jul 22, 2015
1 parent 8a49050 commit 270747a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 8 deletions.
53 changes: 46 additions & 7 deletions dist/ngCart.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ angular.module('ngCart', ['ngCart.directives'])
this.$cart.items = [];
localStorage.removeItem('cart');
};

this.isEmpty = function () {

return (this.$cart.items.length > 0 ? false : true);

};

this.toObject = function() {

Expand Down Expand Up @@ -348,7 +354,13 @@ angular.module('ngCart.directives', ['ngCart.fulfilment'])
data:'='
},
transclude: true,
templateUrl: 'template/ngCart/addtocart.html',
templateUrl: function(element, attrs) {
if ( typeof attrs.templateUrl == 'undefined' ) {
return 'template/ngCart/addtocart.html';
} else {
return attrs.templateUrl;
}
},
link:function(scope, element, attrs){
scope.attrs = attrs;
scope.inCart = function(){
Expand Down Expand Up @@ -376,7 +388,13 @@ angular.module('ngCart.directives', ['ngCart.fulfilment'])
restrict : 'E',
controller : 'CartController',
scope: {},
templateUrl: 'template/ngCart/cart.html',
templateUrl: function(element, attrs) {
if ( typeof attrs.templateUrl == 'undefined' ) {
return 'template/ngCart/cart.html';
} else {
return attrs.templateUrl;
}
},
link:function(scope, element, attrs){

}
Expand All @@ -389,7 +407,13 @@ angular.module('ngCart.directives', ['ngCart.fulfilment'])
controller : 'CartController',
scope: {},
transclude: true,
templateUrl: 'template/ngCart/summary.html'
templateUrl: function(element, attrs) {
if ( typeof attrs.templateUrl == 'undefined' ) {
return 'template/ngCart/summary.html';
} else {
return attrs.templateUrl;
}
}
};
}])

Expand All @@ -402,18 +426,33 @@ angular.module('ngCart.directives', ['ngCart.fulfilment'])
$scope.checkout = function () {
fulfilmentProvider.setService($scope.service);
fulfilmentProvider.setSettings($scope.settings);
var promise = fulfilmentProvider.checkout();
console.log(promise);
var promise = fulfilmentProvider.checkout()
.success(function (data, status, headers, config) {
$rootScope.$broadcast('ngCart:checkout_succeeded', data);
})
.error(function (data, status, headers, config) {
$rootScope.$broadcast('ngCart:checkout_failed', {
statusCode: status,
error: data
});
});
}
}]),
scope: {
service:'@',
settings:'='
},
transclude: true,
templateUrl: 'template/ngCart/checkout.html'
templateUrl: function(element, attrs) {
if ( typeof attrs.templateUrl == 'undefined' ) {
return 'template/ngCart/checkout.html';
} else {
return attrs.templateUrl;
}
}
};
}]);;
}]);
;
angular.module('ngCart.fulfilment', [])
.service('fulfilmentProvider', ['$injector', function($injector){

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.

0 comments on commit 270747a

Please sign in to comment.