Angular 2 – List of events

The default handled events should be mapped from the original HTML DOM component’s events:

http://www.w3schools.com/jsref/dom_obj_event.asp

by just removing the on prefix.

onclick —> (click)

onkeypress —> (keypress)

etc…

You can also create your custom events.

However ngInit is not an HTML event, this is part of the Angular’s Component lifecycle, and in Angular 2 they are handled using “hooks”, which are basically specific method names inside your component that will be called whenever the component enters the specific cycle. Like:

ngOnInit

ngOnDestroy

etc…

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)