Solved it!
Here's my code:
controller.js
app.controller('SuggestionsCtrl', ['$scope', 'suggestionService', '$state', function($scope, suggestionService, $state){
$scope.suggestionId = $state.params.suggestionId;
suggestionService.getAll()
.success(function(data) {
$scope.suggestions = data;
});
suggestionService.get($scope.suggestionId)
.success(function(data) {
$scope.suggestion = data;
});
service.js
app.factory('suggestionService', ['$http', function($http) {
var baseUrl = 'path_to_data';
return {
getAll: function() {
return $http.get(baseUrl);
},
get: function (id) {
return $http.get(baseUrl + '/id=' + id);
}
}
detail.html
<ion-item ng-repeat="detail in suggestion | filter: {id:suggestionId}">
<img ng-src="{{ detail.titelbildUrl }}" class="full-width">
<h2>{{ detail.titel }}</h2>
<p>{{ detail.beschreibung }}</p>
</ion-item>
</ion-list>