Form-Validierung angepasst

This commit is contained in:
2016-01-07 23:03:01 +01:00
parent 307d5a772c
commit a2b2b6b37e
64 changed files with 198 additions and 67 deletions

View File

@@ -5,21 +5,8 @@ angular.module('starter.controllers', [])
$scope.preis="";
$scope.name="";
$scope.freitext="";
var showAlert=0;
$scope.validate = function() {
showAlert=0;
if ($scope.name.length < 1){
showAlert=1;
}
if ($scope.freitext.length < 1){
showAlert=1;
}
if (showAlert==1){
$scope.showAlert();
return;
}
var link = 'http://api.raataar.de/rosen/vorschau.php';
@@ -31,18 +18,9 @@ angular.module('starter.controllers', [])
};
$scope.showAlert = function() {
var alertPopup = $ionicPopup.alert({
title: 'Uuuupppsssiii',
template: 'Bitte prüfe deine Eingaben.'
});
alertPopup.then(function(res) {
console.log('Thank you for not eating my delicious ice cream cone');
});
};
function buysuccessHandler (result) {
inappbilling.consumePurchase(successHandler, errorHandler, "3xrose");
inappbilling.consumePurchase(successHandler, errorHandler, $scope.preis);
}
function successHandler (result) {
@@ -64,7 +42,7 @@ angular.module('starter.controllers', [])
alert($scope.preis);
if((window.device && device.platform == "Android") && typeof inappbilling !== "undefined") {
inappbilling.buy(buysuccessHandler, errorHandler,"3xrose");
inappbilling.buy(buysuccessHandler, errorHandler, $scope.preis);
}
}

View File

@@ -39,8 +39,8 @@
<div class="row">
<div class="col col-50"><button class="button button-full button-small icon-left ion-image button-custom" ng-click="validate()">Vorschau</button></div>
<div class="col col-50"><button class="button button-full button-small icon-left ion-social-euro button-custom" ng-click="buyAdFree()">Jetzt Kaufen</button></div>
<div class="col col-50"><button class="button button-full button-small icon-left ion-image button-custom" ng-disabled="!$parent.preis || !$parent.name || !$parent.freitext" ng-click="validate()">Vorschau</button></div>
<div class="col col-50"><button class="button button-full button-small icon-left ion-social-euro button-custom" ng-disabled="!$parent.preis || !$parent.freitext || !$parent.name" ng-click="buyAdFree()">Jetzt Kaufen</button></div>
</div>