How can I link external json file in JSFiddle?

后端 未结 6 1455
北荒
北荒 2021-02-06 07:33
  • I have a very long .json file country.json.

[
  {
    "name": "WORLD",
    "population": 6916183000         


        
6条回答
  •  旧时难觅i
    2021-02-06 08:10

    Step 1

    Go to http://myjson.com/

    I pasted in my json data and hit save I will then get a this link:

    https://api.myjson.com/bins/3ffb0

    enter image description here


    Step 2

    Now that I have that URL, I use it like this

        $http.get('https://api.myjson.com/bins/3ffb0').success(function(data) {
          $scope.countries = data;
        });
    

    My Result

    Work like a charm. No complain. :D


提交回复
热议问题