Reloading page on modal close in AngularJS -
questions angularjs newbie.
this 2 part problem.
i have page has drop down (populated using web service), text box , button 'go'. button ng-click causes value of drop down , text box hit web service returns json use display grid (id, name). grid has delete button each row. inside 1 controller controllera.
when delete button clicked, open modal http://angular-ui.github.io/bootstrap/ has yes , no button. modal in different controller controllerb.
q1. how can value of id (row users want delete) in controllerb? using global var variable set in controllera , in controllerb don't think correct way?
q2. when users click yes on modal (controllerb), how can reload page , display refreshed grid (controllera) - how can value of dropdown , textbox in controllerb , how can call controllera's ng-click function in controllerb?
q1: check out this page example on how pass information modal dialog. need specify resolve property when calling $modal.open.
q2: see example again. in controllera, can call modalinstance.result.then(...) , provide function called when model dialog dismissed. inside function, can make whatever web service call wish, , when web service call returns, success function can update $scope array variable populates data grid.
Comments
Post a Comment