Ionic json file[SOLVED]

hello,
i am trying to read from a json file on a server.i tried.i got some errors.including uncaught syntaxerror unexpected.i followed a tutorial :http://samcroft.co.uk/2016/loading-json-into-an-ionic-app/.i used another service and used get insted of jsonp.i added callback=JSON_CALLBACK to the link but nothing.no errors.no console log.here’s my code
`
angular.module(‘app.services’, [])

.factory(‘Articles’, function($http,$q) {
var url = ‘https://www.yabiladi.com/newsapi.json?callback=JSON_CALLBACK’;

//allarticles
return {
getArticles: function() {
return $http.jsonp(url);
},
//articlebyid
getArticle: function(articleId) {
return $http.jsonp(url, {
params: {
id: articleId
}
});
}
}
})

.service('servicearticles',function($http,$q)
{
    
    var deferred=$q.defer();
    $http.get('https://www.yabiladi.com/newsapi.json?callback=JSON_CALLBACK').then(function(response)
    {
      deferred.resolve(response);

    });
    this.getArticles=function()
    {
        return deferred.promise;
    }
})

angular.module(‘app.controllers’, [])

.controller(‘articlesController’, function(servicearticles, $scope) {

     servicearticles.getArticles().then(function(response){
            $scope.articles = response.data;
            console.log(articles);
        }).catch(function(response){
            //request was not successful
            //handle the error
        });
    })

     .controller('articleDetailController', function(Articles, $stateParams, $scope) {

    
        Articles.getArticle($stateParams.articleId).then(function(response){
            $scope.article = response.data;
        }).catch(function(response){
            //request was not successful
            //handle the error
    });
});

`

ion-view title="Articles" id="page1"> <ion-content padding="true" class="has-header"> <ion-list> <ion-item ng-repeat="article in articles.articles" ng-href="#/articles/{{article.id}}"> {{article.titre}} </ion-item> </ion-list> </ion-content> </ion-view>
`
$stateProvider

  .state('articles', {
url: '/page1',
templateUrl: 'templates/articles.html',
controller: 'articlesController',
controllerAs: 'articles'

})
.state(‘details’,{
url:’/page2/:articleid’,
templateUrl:‘templates/details_article.html’,
controller :‘ArticleDetailController’,
controllerAs: ‘articleDetail’
})

$urlRouterProvider.otherwise(’/page1’)
});`

thank for your help

Very strange… no errors? no console log? Really strange… where do you test it? Browser? Android? Ios? ionic serve?

Try adding:

    cache: false,

to .state(‘details’…

i run in in the browser

i added it to the states file.nothing

how to solve this error : Uncaught SyntaxError: Unexpected token.

You’re a little cryptic… what is the line of the error? on what file?

it shows in the console.and it’s related to the json file i am trying to load.right now.actually the error is gone.i dropped jsonp.the thing is i get like an infinite loop.i am cryptic because i am new to ionic
.items keep on loading then Chrome is bugging.the aie aie aie dude appears.here a link to a codepen i made

An incomplete codepen is near useless. Try to load json locally or even from string variable and check. If it works, then try to load json from remote.

i managed to load the json file correctly.without problems.thank you for the help