Closed al5dy closed 9 years ago
Try adding a function onto the scope of your controller as below and then call it from the button with an ng-click
<button ng-click="changeShipping(200)">Set Shipping</button>
var myApp = angular.module ('myApp', ['ngCart']);
myApp.controller ('myCtrl', ['$scope', '$http', 'ngCart', function ($scope, $http, ngCart) {
$scope.changeShipping = function(amount) {
ngCart.setShipping (amount);
}
}]);
Please note this is not a issue with the plugin and not related to ngCart; Please refer to AngularJS documentation for further help.
Hello! I need at the touch of a button to change the value of html that takes setSnipping. Tell me how it can be implemented in a standard piece of code? var myApp = angular.module ('myApp', ['ngCart']);
myApp.controller ('myCtrl', ['$ scope', '$ http', 'ngCart', function ($ scope, $ http, ngCart) {
ngCart.setTaxRate (0);
ngCart.setShipping (200.00);
}]);