Hi,
For last 2 days, I am facing a problem with reloading/refreshing my view in
dialog box. Below I have mentioned my code:
----------------------------
angular.module("vss_shoppingcart_modal",["ui.bootstrap","dialogs","ngSanitize"]).controller("vss_shoppingcart_dialogService",function($scope,$rootScope,$timeout,$dialogs,$sce){
$scope.init = function(){
dlg = $dialogs.create("Request URL","vssShoppingCartCTRL",{},{key:
false,back: "static"});
};
}) // end dialogsServiceTest
.controller("vssShoppingCartCTRL",function($scope,$rootScope,$sce,$http,$modalInstance,data){
$scope.cancel = function(){
$modalInstance.dismiss("canceled");
}; // end cancel
$scope.removeProduct = function(event){
$http({
method: "GET",
url: event.target.id
}).
success(function(data, status, headers, config) {
* // Here I want to refresh the dialog box*
}).
error(function(data, status, headers, config) {
// or server returns response with an error status.
});
}; // End removeProduct
$scope.updateQuantity = function(event){
$http({
method: "POST",
url: "Request URL",
data: { "product_id": event.target.id, "qty": "2",
"update_cart_action":"update_qty"}
}).
success(function(data, status, headers, config) {
* // Here I want to refresh the dialog box*
}).
error(function(data, status, headers, config) {
// or server returns response with an error status.
});
}; // End updateQuantity
$scope.applyCoupon = function(){
var coupon = angular.element( document.querySelector( "#coupon_code" )
).val();
$http({
method: "POST",
url: "Request URL",
data: { "ajax": "true", "coupon_code": coupon}
}).
success(function(data, status, headers, config) {
* // Here I want to refresh the dialog box*
}).
error(function(data, status, headers, config) {
// or server returns response with an error status.
});
}; // End updateQuantity
}); // end whatsYourNameCtrl
// module
----------------------------
Dialog box is opening and ajax request are working fine but I am not able
to find any way to refresh the dialog box content. After success, I just
want to show the updated data in dialog box. Please help me with this
because I am struggling with this issue for last 2 days.
Thanks
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.