submit a form on enter angular 1

submit a form on enter angular

(keyup.enter)=yourFunction

Here is what the above code is Doing:
1. We are using the @HostListener decorator to listen to the host’s keyup event.
2. We are using the @HostBinding decorator to bind the host’s tabindex attribute to the directive’s tabIndex property.
3. We are using the @Input decorator to make the directive’s tabIndex property configurable from the outside.
4. We are using the @Output decorator to make the directive’s enterClicked event emittable from the outside.
5. We are using the @HostBinding decorator to bind the host’s (button) disabled attribute to the directive’s isDisabled property.
6. We are using the @Input decorator to make the directive’s isDisabled property configurable from the outside.
7. We are using the @HostListener decorator to listen to the host’s (button) click event.
8. We are using the @Output decorator to make the directive’s clicked event emittable from the outside.

Similar Posts