How to handle Events in Angular 5?



How to handle Events in Angular 5?..

Answer / Gyanendra Singh

In Angular 5, events are handled using the EventEmitter and OnInit interfaces. To create a custom event, you can extend the EventEmitter class, and then trigger it with the emit() method. To listen to an event, use the @Output decorator in the component where you want to handle the event.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AngularJS Interview Questions

What is dependency injection (di)? Why use?

1 Answers  


How to enable and disable buttons with using condition?

1 Answers  


When to use $destroy() function of scope?

1 Answers  


What is the use of angular 7?

1 Answers  


Whats is a filter?

1 Answers  


What is a template in angular?

1 Answers  


What is the difference between an observable and a promise?

1 Answers  


Difference between service, directive, and module?

1 Answers  


Can we use angularjs in android?

1 Answers  


What makes angular.js better?

1 Answers  


How would you use a route guard?

1 Answers  


In what ways can you use a directive?

1 Answers  


Categories