Form-Validierung angepasst
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
angular.module('starter.controllers', [])
|
||||
|
||||
.controller('DashCtrl', function($scope,$ionicPopup) {
|
||||
.controller('DashCtrl', function($scope,$ionicPopup,$http) {
|
||||
|
||||
$scope.preis="";
|
||||
$scope.name="";
|
||||
@@ -18,7 +18,16 @@ angular.module('starter.controllers', [])
|
||||
|
||||
if (showAlert==1){
|
||||
$scope.showAlert();
|
||||
return;
|
||||
}
|
||||
|
||||
var link = 'http://api.raataar.de/rosen/vorschau.php';
|
||||
|
||||
$http.post(link, {name : $scope.name, freitext: $scope.freitext, rosen: $scope.preis}).then(function (res){
|
||||
$scope.response = res.data;
|
||||
window.open($scope.response, '_system', 'location=yes');
|
||||
return false;
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
@@ -32,7 +41,11 @@ angular.module('starter.controllers', [])
|
||||
});
|
||||
};
|
||||
|
||||
function successHandler (result) {
|
||||
function buysuccessHandler (result) {
|
||||
inappbilling.consumePurchase(successHandler, errorHandler, "3xrose");
|
||||
}
|
||||
|
||||
function successHandler (result) {
|
||||
var strResult = "";
|
||||
if(typeof result === 'object') {
|
||||
strResult = JSON.stringify(result);
|
||||
@@ -40,25 +53,18 @@ angular.module('starter.controllers', [])
|
||||
strResult = result;
|
||||
}
|
||||
alert("SUCCESS: \r\n"+strResult );
|
||||
}
|
||||
}
|
||||
|
||||
function errorHandler (error) {
|
||||
function errorHandler (error) {
|
||||
alert("ERROR: \r\n"+error );
|
||||
}
|
||||
|
||||
$scope.buyAdFree = function() {
|
||||
|
||||
|
||||
|
||||
alert($scope.preis);
|
||||
|
||||
if((window.device && device.platform == "Android") && typeof inappbilling !== "undefined") {
|
||||
|
||||
|
||||
alert($scope.preis);
|
||||
inappbilling.buy(successHandler, errorHandler,"3xrose");
|
||||
inappbilling.consumePurchase(successHandler, errorHandler, "3xrose");
|
||||
|
||||
|
||||
inappbilling.buy(buysuccessHandler, errorHandler,"3xrose");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user