In this video, take a look at a different group of filters which allow you to work with lists. You can also use them to search through your list for a series of elements.
- [Narrator] In the last video,…we looked at text transformation filters.…Now there's a different group of filters…that allow you to work with lists,…otherwise known as arrays, and we can use them to create…a live search in our application.…So the first one I want to talk about is called limitTo,…and it creates a new array by showing you…only a certain number of elements from an array.…This could be useful for things like pagination.…What you do is, you specify…the number of elements that you want to show…and then when you should start showing those elements,…so what position in the array…you want to start showing elements.…
Although it's a bit confusing, the next filter…is also called filter,…and this one will allow you to specify a keyword…that will narrow the list of elements…that show up in an array based on a certain keyword.…And so we can use that to create our search.…The last one is called orderBy, and it lets you control…the order of the array, based on a key,…and also whether or not this is in normal or reverse order.…
In this short, practical course, Ray Villalobos uses AngularJS to build a searchable directory—a project you can use as the basis for your own employee or user directory. He explains the MVC architecture underlying AngularJS, and the differences you can expect to encounter in Angular 2. Then he shows how to control the display of DOM elements and data; use services like $http and $routeProvider; modify content with filters; add two-way data binding; and work with routes and templates. Start watching, and learn the simple way to build your own complex web application with AngularJS.
- What is AngularJS?
- Binding data
- Defining modules and controllers
- Using the $http service to read a JSON file
- Controlling app logic with conditionals and loops
- Filtering content and lists
- Deep linking