I am looping over Json array in view, I want to pass the item to another controller. How do I pass the item object (JSON) from html view page to another controller in ionic.
rentlist.html
<ion-item style="padding: 2px; border-width: 0px;" ng-repeat="acc in accs"
item="acc" >
<div id="wrapper" class="item item-word-wrap" ng-click="selectAcc(acc)">
<table style="table-layout: auto; width: 100%;">
<tr>
<td style="width: 25%;">
<div id="first">
<img style="display: inline-block;" ng-src="{{acc.image}}">
</div>
</td>
<td style="width: 55%; vertical-align: top;">
<div id="second">
<div id="third">{{acc.title}}</div>
<div id="fourth">{{acc.address}}</div>
<div id="fifth"><a ng-href="#/detail/{{acc}}">View Details</a></div>
</div>
app.js
.state('detail', {
url: '/detail/{acc:json}',
templateUrl: 'js/detail.html',
controller: 'detailCtrl'
})
detail.js
$scope.accs = [];
$scope.accs = $stateParams.acc;
This is the JSON data which i need to send it to other controller
<a ng-href="#/detail/{"address":"Lachs Straße","contact_number":"0160933","description":"Quiet and cozy flat with big windows and essential furniture.","title":"Single-room apartment for three semesters","type":"Flat","total_size":50,"img":"img/studierent_logo.png}