Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49087

My $cordovaDialogs.alert is not working in my browser

$
0
0

@Pajimola wrote:

.controller('LoginCtrl', function($scope, $state, $rootScope, $cordovaDialogs, LoginService){

$scope.form = {};

$scope.submit = function(){

// TODO: Add some native loading

if((angular.isDefined($scope.form.username)
  && $scope.form.username !== "")
  && angular.isDefined($scope.form.password)
  && $scope.form.password !== ""){

  LoginService.login($scope.form).then(function(response){
    var str = response.data;
    str.replace(/\s/g, '');

    if(str === "1")
    {
      $cordovaDialogs.alert('Login success!', 'Login', 'Ok').then(function() {
        // callback success
      });
      if(Storage){
        localStorage.setItem('loginDetails', JSON.stringify($scope.form));
      } else {
        $cordovaDialogs.alert('Storage is not defined in this browser. Please use other storage.', 'Login', 'Ok').then(function() {
        // callback success
        });
      }
    }
  }, function(error){

  });
  $state.go('tab.chats');

} else {
  // TODO: Add native message box
}

}

});

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49087

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>