How to load json file into Angularjs for ng-repeat

前端 未结 3 1457
春和景丽
春和景丽 2021-01-16 06:03

I have a simple json file with a list of artist names, like

[\"Vincent van Gogh\", \"Leonardo da Vinci\", \"Pablo Picasso\"]

I can\'t figur

3条回答
  •  盖世英雄少女心
    2021-01-16 06:41

    you can try this:

     $http.get("/home/user/artist_names.json")
        .success(function(response) {$scope.artists = response;});
    

提交回复
热议问题