I have a login form for a user to type his/her password. This form is bound to an AngularJS model. Suppose that in the corresponding controller the user-given password is available via $scope.password
.
The actual login procedure is handled by this function call: login($scope.email, $scope.password)
. After that procedure the application logic does not need the password anymore and my wish is to clear it from the browser's memory.
To me, the most obvious question is: what can I do right after calling login($scope.email, $scope.password)
in order to clear the memory holding the value that $scope.password
is currently bound to? This question is valid for JavaScript in general, I hope.
But then, following up from here, I have two more AngularJS-specific questions:
Is the password form value bound to more AngularJS-internal variables than just to
$scope.password
? In that case, overriding$scope.password
would not be helpful.When switching the view, the controller corresponding to the old view and its scope become "destroyed". Should I simply rely on the garbage collection to clear the memory containing the password within a short time interval after switching away from the login view?