Join Ray Villalobos for an in-depth discussion in this video Refining our search, part of AngularJS 1: Building a Data-Driven App.
- AngularJS makes it easy to search through…records by allowing you to create filters.…But filters a lot more flexible…than just tying an input field to a model.…So let's go ahead and add some form elements,…that are going to help us organize our records…a little bit better.…So right here,…where we are including the input field,…we can add some additional elements.…So I'm going to add a class,…or rather a div with a class of 'formgroup'.…And this is just the style that…I've used to organize groups of input fields.…
So then, I'm going to add a span…with a class of 'label' here,…and just put a label that says 'by:',…and what I'm going here is creating…a pop-up list of items to sort by.…So I'm going to say 'sort by'…and then I need to include a select,…and I'll give it a ng-model,…so this will be the variable that we create,…and it's going to be called 'order'.…We'll use this to order our search,…and then of course, in a normal select,…you create first the item that is the select,…and then you create a series of options.…
Although it's easy to learn, AngularJS can be hard to master. With these project-based lessons, you'll learn how the framework works in the real world, and see how data-driven programming can help your apps react to real-time data streams.
- Creating a new view
- Adding, showing, and deleting database records
- Using events to track meetings
- Adding a form to the app
- Creating methods
- Controlling views with classes