javascript - clear sorting button of ngtable is calling form submit -


i using ng-table inside form.

    <form role="form" name="frmcommand"  class="formvalidcommand" novalidate="novalidate" ng-submit="frmcommand.$valid && vm.savecommandchanges()"> 

i have clear sorting button on table.

                <button ng-click="storecommandstableparams.sorting({})" class="btn btn-default pull-right">clear sorting</button> 

clicking button calling vm.savecommandchanges() instead of clearing sort.

any suggestions please?

default type attribute value button tag submit, when click on it trigger parent form's submit event captured ng-submit directive. try change button type submit event not happen.

ie.

<button     type="button"    ng-click="storecommandstableparams.sorting({})"     class="btn btn-default pull-right">clear sorting</button> 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -