Hello, I am new to this platform. What I am trying to do is that when I click on the login button, it will check username and password input areas if they are empty or not. If they are empty a popup will appear, if not screen will navigate to next page. But when I try neither of them happens. Here is my code;
HTML;
<div ng-app="" ng-controller="PopupCtrl" class="list">
<label class="item item-input">
<span class="input-label">Kullanıcı Adı</span>
<input ng-model="username" type="text">
</label>
<label class="item item-input">
<span class="input-label">Şifre</span>
<input ng-model="password" type="password">
</label>
</div>
<center>
<a ng-app="" ng-controller="PopupCtrl" class="button size icon-right ion-log-in headerColor title headerTitle"
ng-click="ChechIsEmpty()">GİRİŞ</a>
</center>
JS;
app.controller('PopupCtrl',function($scope, $ionicPopup, $timeout) {
$scope.ChechIsEmpty = function () {
if ($scope.username == "" || $scope.password == ""){
var alertPopup = $ionicPopup.alert({
title: 'Yetersiz Bilgi!',
template: 'Kullanıcı adı veya şifrenizi kontrol ediniz.'})
}
else
$state.go('#/templates/second');
}
});
What am I doing wrong?