How to create login


#1

how to create login i have a server and i have a web service…
how to compare username and password in our controller…

please help me i am new in ionic framewok


#2

Hello,

What is your actual problem ?
What is your server doing, what is your web service doing ?
You are not providing us any information so we can help you.

Be more precise, tell us what you already did and what you really want to achieve and we might be able to give you some tips.


#3

.controller(‘AppCtrl’, function($scope, $ionicModal, LoginService, $timeout, $http) {
$scope.loginData = {};

$ionicModal.fromTemplateUrl(‘templates/login.html’, {
scope: $scope
}).then(function(modal) {
$scope.modal = modal;
});
$scope.closeLogin = function() {
$scope.modal.hide();
};
$scope.login = function() {
url = “http://www.abcd.com/app-abcd/login.php?email=ashsh@gmail.com&password=ashish”;
$http.get(url)
LoginService.loginUser($scope.loginData).success(function(data) {
$state.go(‘tab.playlists’);
}).error(function(data) {
console.log(data);
});
$scope.modal.show();
};
$scope.doLogin = function() {
$scope.data = {};
console.log($scope.loginData);
$timeout(function() {
$scope.closeLogin();
}, 1000);
};
})

how to create login with the help following code…


#4

So what’s the problem? Errors?