We have restricted the maximum number of characters in the textbox using another input decorator. Angular trim your input using Directive | by Raymond | Medium The ng-change directive from AngularJS will not override the element's original onchange event, both the ng-change expression and the original onchange event will be executed. All the form elements events are the type React.ChangeEvent , where T is the HTML Element type. We mostly clear the input field values after submitting a form or resetting the wrong information inside the form. Join the community of millions of developers who build compelling user interfaces with Angular. Using event Binding (1-way) We can use event binding with HTML input to get data in the controller. As per documentation [()] is for two way syntax sugar to remove the boilerplate. The data-binding and validation properties of this element are exactly the same as those of the input element. To bind to a DOM event, surround the DOM event name in parentheses and assign a quoted template statement to it. In our test cases, we will verify that … cd /go/to/workspace ng new databind-app cd databind-app. Then on submit event we will take that values with state variable. I open the modal like this So here we are going to discuss 4 different ways to do so. [formContro... (keyup): (keyup) is an Angular event binding to respond to any DOM event.It is a synchronous event that is triggered as the user is interacting with the text-based input controls.