0

I have an ng-model="name" in my html page. It is connected to the main controller. The model is used to submit the name in a form using ng-submit= formfilled(name). But after the form is submitted, I want the name input field to be blank again. How can I do this?

I was trying to do $scope.name = "" on my controller after the form is submitted, but it's not working.

If I understand correctly, the ng-model creates the name you give it as a variable in the scope right?

Serhii Holinei
  • 5,758
  • 2
  • 32
  • 46
  • `ng-model="name"` will create property `name` in `scope`, indeed. Can you show us how do you clean name value on form submit? – Serhii Holinei Jun 21 '16 at 19:33
  • 4
    http://stackoverflow.com/questions/21571370/resetting-form-after-submit-in-angularjs – Phil Jun 21 '16 at 19:33

0 Answers0