javascript - How can I access the function applied in success of an $http.post? -


I'm starting this function when I click on a button.

  .controller ( 'Formctrl' function ($ scope, ichrisLayoutLeavebalanceService) {$ scope.listRowSelected = function (list, item) {var det = {detnumber: item.detnumber}; ichrisLayoutLeavebalanceService.callPost (DET) .success (function) (ichrisLayoutLeavebalanceService.leaveBalanceProcess ();});};});  

However, it seems that I can not use the holiday balance process (). It seems that only the factory part is able to share. Here is my controller and factory code which is accessed by the above code.

 . Directive (/ * code ... code ... * / / / code ... long code ... * / / * Code ... code ... * /} controller ($ scope, ichrisLayoutLeavebalanceService) { function equals () {// code ... code ...} $ scope.leaveBalanceProcess = function () {/ * code ... code ... * /} $ scope.build = function () {ichrisLayoutLeavebalanceService.callPost (equals ()) success (function (data) {$ scope.leaveBalanceProcess (data)}) ;.} $ scope.build ();}}) .factory ( 'ichrisLayoutLeavebalanceService', [ '$ http', function ($ http) {var leaveBalanceService = {}; leaveBalanceService.callPost = function (equal) {$ http.post (back '/ api / values ​​/ entries / LeaveBalanceEntries', equal);} leaveBalanceService return;  

}]);

So now how can I acces the whole controller?


Comments

Popular posts from this blog

c# - XML serialize base class without knowing derived class -

c# - UnhandledExceptionMode.ThrowException for AppDomain.UnhandledException -

udp - The relationship between MTU and size of skb in xmit function -