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?