From the course: Building a Mobile App with AngularJS 1 and Ionic

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Filtering our searches

Filtering our searches

- Our good app is looking pretty good, but obviously this search right here isn't working. So, Angular makes it easy to make something like search work with it's ability to create something called Two-way Data Binding. In addition to that, you can easily add features like filtering. So, let's take a look. Now the key to makin' this work is called Two-way Data Binding. And that means that your models, which are your data and your views, which are your template, are linked together so that when one changes the other one is gonna change as well. So, to create a search all I have to do is find the input field right here and add a directive, and this one is called ng-model. And this is a directive that belongs to input fields in Angular. And this directive is going to create a model in the current scope, that really just means a variable. So, I'm going to type in the word "query" here, So, now that I've done this that means that we have a new variable in our scope called query. And that…

Contents