June 2014
Intermediate to advanced
696 pages
38h 52m
English
With the /word route handler in place, you can implement the AngularJS controller that accesses the list of words displayed in the table. Listing 29.17 implements tableController in the AngularJS application Module object.
The first few lines define the words array, which contains the data for the table as well as the contains, limit, skip, and direction values used in the $http GET request to retrieve the set of words. The sortFields array provides data to select which field to sort on.
The getWords() function makes an $http GET request to the /words route and populates the $scope.words array that is bound to the table data with the results. Notice that the limit, skip, sort, direction, and contains fields ...
Read now
Unlock full access