I have fetched json data from a url which contains data with unique id , I want to show more details about particular id in another page as like in ionic tabs demo template
app.js
.state('tab.search', {
url: "/search",
views: {
'tab-bus': {
templateUrl: "templates/search.html",
controller: 'SearchCtrl'
}
}
})
.state('tab.bus-detail', {
url: '/search/:busId', //**How to get id from the json and pass it in busId**
views: {
'tab-bus': {
templateUrl: 'templates/bus-detail.html',
controller: 'BusDetailCtrl'
}
}
})
controller.js
.controller('SearchCtrl',['$scope','$http',function($scope,$http){
$http.get("templates/search.json").success(function(response){$scope.bus=response.availableTrips;});
}])