When I press Sign In in my autorization it should change the signInValid to true,but unfortunetly only alert working:(
And is it correct to use FOR in angularJS to see is login and pass correct? Or there are some better ways to do it?
Here`s my JS code:
$scope.signInValid = false;
$scope.signIn = function (userDetails) {
for (let i = 0; i < $scope.userlist.length; i++) {
if (userDetails.login == $scope.userlist[i].username && userDetails.password == $scope.userlist[i].password) {
alert('welcome')
$scope.signInValid = true;
}
}
}
Here`s HTML code:
<h1>Permissions allowed: <span style="{{setStyle(signInValid)}}">{{signInValid}}</span></h1>