In this new version of Angular, filters are called pipes and some of the popular filters are gone, so if you need to build a query filter for your application, you'll need to do it manually.
- [Man] In AngularJS1, filters allow you to control…how some data was displayed,…and in this new version of Angular,…filters are called Pipes.…So let's take a look at what it would take…to create a Pipe that filters our artists.…A Pipe in Angular takes in data as an input,…and modifies it so that it gives you a desired output.…There are some built in Pipes,…and if you go to the API documents,…and you type in Pipe right here.…This is actually a type of filter…that we want to be building.…
You can see that there are some common Pipes here…that you can use.…So for example, the uppercase Pipe will let you…take an element and convert its value to uppercase.…There's also a lowercase version of that.…If we look at our artist item, that HTML file,…then we can use a Pipe right here,…and call uppercase.…And now if we type something in here…we can see that all of these are now uppercase letters.…
That's a little bit useful.…There are some more useful Pipes.…There is a lot of stuff that you can do, for example,…with,…dates.…The date Pipe is probably a little bit more useful,…
In this course, Ray Villalobos shows you how to start using Angular 2 in your own projects. He starts by defining what exactly Angular 2 is and how it differs from AngularJS 1. Then, once the basics are out of the way, he sets up the template that will drive the project and starts coding. Ray shows how to divide your project into modules, work with events, style content with CSS, and create components and subcomponents. Plus, you can find out how to change content dynamically using data pipes.
Note: Members can find a template to download in the exercise files.
- What is Angular 2?
- Setting up a template
- Creating a simple component
- Using multiple modules
- Displaying data in templates
- Working with events
- Creating a subcomponent
- Filtering content through data pipes