Why this verifying dont work?I need that when the button is clicked, you need to check if the input is empty.
controller:
$scope.closeCart = function(){ if(!$scope.name){ $scope.modal.hide(); $scope.items.splice($scope.items); } else{ $ionicPopup.alert({ title: "Coloque um nome de identificação para retirada do produto!", okText: "Confirmar", okType: "button-dark" }); } }; html:
<label class="item item-input"> <span class="input-label">Name:</span> <input ng-model="name" type="text" placeholder="your name"> </label> <button class="button button-large button-full button-assertive" ng-click="closeCart()">Pagar</button>