I am attempting to retrieve an array from a remote server that is connected to a dynamic database.
From what I have gathered on Ionic forums, it seems that I need to utilize the $http function from AngularJS. However, since I am new to AngularJS, the current examples appear overly complex for me, like this one.
I am aiming to adapt this example to work with Remote JSON data.
HTML Section:
<ion-list>
<ion-item ng-repeat="item in items"
item="item"
href="#/item/{{item.id}}">
Person {{ item.id }} Name {{ item.name }}
</ion-item>
</ion-list>
Array Section:
var friends = [
{ id: 1, name: 'G.I. Joe' },
{ id: 2, name: 'Miss Frizzle' },
{ id: 3, name: 'Scruff McGruff' },
// more data here...
];
I have attempted the following options:
$scope.items = jsonp('http://www.garsoncepte.com/json.php');
$scope.items = $http.jsonp('http://www.garsoncepte.com/json.php');
var url = "http://www.garsoncepte.com/json.php"; $scope.items = $http.jsonp(url);