Why your cancel button submit the html form
One of the mistake which I see often during development on the frontend side is the cancel button, which actually submits the form when clicked. Saw it once, wait a while, saw it again, wait a while, saw it again, and the loop continues. Some people doesn’t even realize.
So what’s the problem? Let’s take a look at a normal html form in AngularJS. HTML Code
<div ng-app="MyApp"> <div ng-controller="MyController"> <form ng-submit="submitTheForm()"> <div class="form-group"> <label for="name">Name</label> <input type="text" class="form-control" ng-model="someone.