Join Ray Villalobos for an in-depth discussion in this video Working with events, part of Learning AngularJS 2 (2016).
- [Voiceover] Another really important thing to learn…when developing applications is how to deal with events.…Now events allow you to respond to any sort of user input.…AngularJS has a special notation to deal with events.…First of all, let's go ahead and simplify…our data structure and our AppComponent, so that…it doesn't use this more complicated notation.…So I'm going to delete this right here.…Delete the constructor and just set…the name like this and…then this other variable called artists and…we'll just make this some simple…names of artists right here.…
Let's go ahead and add them.…Alright, because we've simplified the data, that…means that we also need to change our template.…Let's go ahead and save this and…back in our app.html, we need to modify this.…We're just going to output the name,…which right now is on just the item parameter.…As we go through the loop of artists, which is now…an array, then the item is just the name of each artist.…
Let's go ahead and save this and you can see…the names appear just fine over here.…
In these tutorials, Ray Villalobos shows you how to start using AngularJS 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, find out how to change content dynamically using data pipes.
The template is included as a free download for all members.
- What is AngularJS 2?
- Setting up our template
- Creating a simple component
- Using multiple modules
- Displaying data in our templates
- Working with events
- Creating a subcomponent
- Filtering content through data pipes