Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $scope.doLogin = function() {
- $scope.loginSubmitted = true;
- $scope.loginstatus==0;
- authService.GetByUsername()
- .success(function(data) {
- $scope.UserData = data;
- console.log($scope.UserData);
- for (var i = 0; i < $scope.UserData.length; i++) {
- if ($scope.UserData[i].UserName == $scope.User.UserName && $scope.UserData[i].Password == $scope.User.Password) {
- $scope.loginstatus=1;
- break;
- }
- }
- if($scope.loginstatus==1){
- $state.go('app.single')
- }
- else {
- console.log('wrong credentials');
- }
- })
- .error(function(err) {
- console.log(err);
- });
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement