# How to create login

**URL:** <https://forum.ionicframework.com/t/how-to-create-login/49100>\
**Category:** ionic-v1\
**Created:** [April 12, 2016, 11:25am UTC](https://forum.ionicframework.com/t/how-to-create-login/49100 "2016-04-12T11:25:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashish2312](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@ashish2312](https://forum.ionicframework.com/u/ashish2312)\
**Post date:** [April 12, 2016, 11:25am UTC](https://forum.ionicframework.com/t/how-to-create-login/49100/1 "2016-04-12T11:25:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JC\_cap](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@JC\_cap](https://forum.ionicframework.com/u/JC_cap)\
**Post date:** [April 12, 2016, 3:08pm UTC](https://forum.ionicframework.com/t/how-to-create-login/49100/2 "2016-04-12T15:08:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ashish2312](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@ashish2312](https://forum.ionicframework.com/u/ashish2312)\
**Post date:** [April 13, 2016, 11:21am UTC](https://forum.ionicframework.com/t/how-to-create-login/49100/3 "2016-04-13T11:21:13Z")

</div>

.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://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…

---

<div class="post-metadata">

**Author:** ![coreelements](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@coreelements](https://forum.ionicframework.com/u/coreelements)\
**Post date:** [April 14, 2016, 8:09am UTC](https://forum.ionicframework.com/t/how-to-create-login/49100/4 "2016-04-14T08:09:32Z")

</div>

So what’s the problem? Errors?
