I am trying to create a clear button to empty the values of an input field. So far it clears the username text box ones but afterwards I cannot clear it again and also the password box doesn't clear at all.
HTML:
<div class="list">
<label class="item item-input">
<span class="input-label">Username</span>
<input type="email" name="username" ng-model="username" ng-minlength="5" required>
</label>
<label class="item item-input">
<span class="input-label">Password</span>
<input type="password" name="password" data-ng-model="password" ng-minlength="6" required>
</label>
</div>
Javascript
$scope.submit = function(username) {
console.log("Thanks " + username);
};
$scope.submit = function(password) {
console.log("Thanks " + password);
};
$scope.clear = function(username, password) {
$scope.username = "";
$scope.password = "";
console.log(username);
console.log(password);
};