title: How to use controller in another controller with all its input values?
body: <pre><code>.controller("transactionTypeController", function($scope, $rootScope, $location, $state, $stateParams, $rootScope){
  
          $scope.checkReserve = function(){
                  //var voucherId = $scope.checked_vouchersId;
                  //var transaction = $scope.checked_transactions;
                  var base = $scope.base;
                  //var newCoupon = $scope.coupons;
                  var tL = $scope.checked_transactions.length;
                  var input = [];
                  for(i = 0; i&lt; $scope.checked_transactions.length; i++){
                      input["transactions["+ i +"][txnId]"] = $scope.checked_transactions[i];
                      input["transactions["+ i +"][txnAmount]"] = JSON.parse($scope.amounts[i].base);
                  }
                  for(i = 0; i&lt; $scope.checked_vouchersId.length; i++){
                      input["vouchers["+ i +"][id]"] = $scope.checked_vouchersId[i];
                  }
                  for(i = 0; i&lt; $scope.coupons.length; i++){  
                      input["coupons["+ i +"][couponCode]"] = $scope.coupons[i];
                  }
                  input['loyaltyId'] = "4ZUZ100001";
                  input['redeemPoint'] = '0';
                  console.log(input);
                  CheckTransactionApi(input);
                  $state.go('reservation detail', {'mobile' : mobile, 'loyaltyId' : loyaltyId});
              }
      })
  </code></pre>