Learn about methods based on user action.
- [Instructor] When users interact with your angular app…sometimes it's necessary to capture…these events and know what's happening…and that's where event binding comes in handy.…Whether it's a simple mouse click…or a given keystroke or a mouse hover,…angular provides you with a way to capture data associated…with these events and call methods…within your component class.…Like property binding, event binding is one way…except it occurs in the opposite direction…which is from the view to the component.…
A basic event binding works by wrapping an event…in parentheses and binding it to a method…that can optionally pass through a target event variable.…Using the previous example, let's say for instance…that we want to toggle our image…every time a user clicks this button.…First we'll add a click event to the button.…We'll remove our disabled property binding.…This is our click event.…
Toggle logo which will be a method that we will create…and let's change purchase to toggle logo.…Alright, so let's also create…the method here in the component class.…
- How components work
- Defining HTML templates
- Defining CSS
- Class binding and style binding
- Property binding and event binding
- Creating routes for navigation
Skill Level Intermediate
Angular 2 Essential Trainingwith Justin Schwartzenberger2h 48m Intermediate
Angular 2: Widget-Based Architectureswith Derek Peruo52m 18s Intermediate
1. Getting Up and Running with Angular
2. Templating Basics
3. Data Binding
5. Tying It All Together
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.