vishnu
vishnu

Reputation: 4599

Passing the value with in the same controller in angularjs

I have a account search modal dialog and i want to pass the value of the account to another view in the same controller.

Once click on the 'search' button, it will go the transaction view, here i am setting the 'accountNumber'. But i am not able to accessing the value inside transaction view.

<label class="item item-input">
   <span class="input-label">Debit Account Number:</span>
   <input type="text" value="" ng-model="fundTransObj.debitAccId" readonly/>
</label>

controller

$scope.fundTransObj = {      
  debitAccId:''      
};
$scope.transactionView = function(){    
    $scope.modal.hide();            
    $scope.fundTransObj = {
      debitAccId: $scope.accountNumber;
    }
    $state.go("Transactions");
  }

Upvotes: 1

Views: 39

Answers (1)

Cr.
Cr.

Reputation: 916

angular route while reinitialization the same controller when your view was changed,try to use $rootscope.

Upvotes: 1

Related Questions