Recently, I successfully created a login form using AngularJS and Firebase. Everything was working well until I encountered an issue where I needed to include a "reset password" link in the view if there was an incorrect login attempt. Here is a snippet of the code:
ref.authWithPassword({
email: $scope.account.email, password: $scope.account.password
}, function(error, authData){
if(error){
$scope.$apply(function() {
// struggle with this part
var reset = 'Reset password?';
reset.link("/pages/recover/");
$scope.authMsg = 'Incorrect credentials. '+reset;
});
} else {
$scope.$apply(function() {
$state.go('app.dashboard');
});
}
}
Although everything seems to be functioning correctly, I am having trouble with the recover password link. Can someone guide me on how to properly create a clickable link in the $scope.authMsg
variable? The link()
method does not seem to work as expected, and inserting the a
tag directly results in displaying the raw HTML rather than rendering it as a link.