Search code examples
javascriptangularjsweb-applicationswampservernetbeans-8

Creating a fantasy footbaall App angular js


So basically I am making a fantasy Web app using Angular JS. I have created a pretty standard list of players by describing them in my controller in a $scope.players array. The user can also select players (which is then pushed into an empty array called $scope.history). But I fear i might have started out in the wrong way.

Considering: 1. each user will have to have their choices saved, and 2.depending on the performance of each player (goals and Assists) per match, they would also have to have their stats updated

Is it better to have all players saved in a JSON file on my wampserver and using $http.get to get the data?


Solution

  • You would not want to store all the data as JSON in your JavaScript code.

    It would make much more sense to store it in a JSON file on your server and retrieve the data using $resource.

    You could also consider building a RESTful API with endpoints designed for the AngularJS application to consume data from and retrieve the data via $http.