Can you help with JSON

Well maybe i’m the newbie but i want to learn ionic framework.
I want to make simple app with working json. But can’t do it. I getting always problem.

    "id": 1,
    "name": "Name One"
    "id": 2,
    "name": "Name Two"
    "id": 3,
    "name": "Name Three"

Here is my json example and i wat to do a list from this json. But i had always an error in examples.
Can you write an example from this json please?

Note: Json will be in my server.

Thank You

What is the error you see?

well i see this topic

and i made a controller
.factory(‘PersonService’, function($http){
var BASE_URL = “”;
var items = [];

    return {
        GetFeed: function(){
            return $http.get(BASE_URL).then(function(response){
                items =;
                return items;
.controller('MyCtrl', function($scope, $timeout, PersonService) {
    $scope.items = [];

        $scope.items = items;


like this


      <ion-item  ng-repeat="item in items">


i write this like example
and change my json
but i see nothing :frowning:

If you are working locally and according to your code you are probably getting this:

XMLHttpRequest cannot load No ‘Access-Control-Allow-Origin’ header is present on the requested resource…

But maybe that is not what you see. Again, what is the error?

XMLHttpRequest cannot load No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:8100’ is therefore not allowed access.

in console i have this error same like you

I solve problem. Thank you for all.

I solved with this

if you use chrome ,you can use this plugin

thank you man that will be usefull in local work :smile:

I have a problem now.
Well now i don’t want make a list I want to get an id and name my json is

"id": 1,
"name": "Name One"

in examples makes alwasy a list but i want to show just id and name not like list. how can i do that? Can you give a little example.
(sorry for bad english)
Thank you

It would expand the api like… and query one item.

Else you could filter data

return $http.get(BASE_URL).then(function(response){
var item= $filter('filter')(, {id:1})[0];
return item;  

$scope.item= item;
alert($ // Name One