September 2015
Intermediate to advanced
268 pages
5h 35m
English
The final feature of our application is to clear the customer registration form. We will add a button, which the customers can click on to clear any input in the form fields. We will add a corresponding method in the module that will clear all observables in the model.
Let's start by updating the view. Next to the Submit button, add a button to view. Label the button Clear. Bind the click event of the button to a method in the module. We will call this method "clear". Your code for button should look similar to this:
<button type="button" class="btn btn-default" data-bind="click: RegistrationForm.clear">Clear</button>
Now that we have updated the view, we can add the clear method to our module. Open the model and add ...
Read now
Unlock full access