I pass the object id that comes from a ng-repeat through $ stateParams more then I would need to get the array object for the id that comes from the URL to display the information. My question is if I have to get this JSON object like I do? And if you have any other way to do this, for example already send the specific object instead of just the id?
controller:
.controller('SingleController', function($scope,$http,$stateParams) {
$stateParams.id;
console.log($stateParams.id);
$scope.dados = Array();
$http.get("js/dados.php").success(function(data){
$scope.dados = data.dados;
console.log($scope.dados);
}).error(function(data){
alert("Error...");
console.log(data);
});
});