Could you please tell me how to set blank or null value for an <input>
field so it is blank when I press the back button press in AngularJS?
I will explain my question:
index.html
file, it shows one form.name :"naveen"
and password :"sharma"
and click "Forget password"."naveen"
and password =`"sharma".I need to reset these fields i.e. means it shows blank or null..
Here is my code:
function authenticationCntrl($scope,$state,Auth) {
$scope.user = [];
console.log('=====authenticationCntrl controller call')
console.log($scope.user.username)
console.log($scope.user.password)
$scope.forgetPassword = function () {
if($scope.user.username==Auth.username && $scope.user.password==Auth.password ){
$state.go('signup')
}
}
}
You can see it running here http://goo.gl/P5RsDU to check out put please press preview button
Change for forgetPassword function as shown below:
$scope.forgetPassword = function () {
if($scope.user.username==Auth.username && $scope.user.password==Auth.password ){
$state.go('signup');
$scope.user.username = '';
$scope.user.password ='';
}
}