Implementing the Tables AngularJS View
With tableController
implemented, you can implement the AngularJS view that utilizes the words data in table form. Listing 29.18 implements a simple template to provide controls to filter, sort, and page the words, as well as display the words in a table.
Note that you populate <select>
by using ng-options
on the sortFields
array. Also, you use the ng-repeat
on the <tr>
element to implement the rows in the table. The individual values for the words data are rendered to the page by using AngularJS expressions.
The limit
field sets the number of rows returned, the contains
field sets the filter for words that contain the text, and sort by
allows you to select a field and direction for sorting. Figure 29.4 ...
Get Node.js, MongoDB, and AngularJS Web Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.