I have tried this code
我试过这段代码。
angular.module('starter', ['ionic','ngCordova'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
})
.controller('datactr',['$scope','$http',function($scope,$http) {
$scope.submit=function(){
console.log("step1");
$http({
method:'POST',
url:'https://awesomeg.2fh.co/updata.php',
crossDomain : true,
data:{
'name':$scope.name,
}
}).success(function(data,status,header,config){
console.log("step2");
console.log(data);
$scope.name="";
$scope.message="You have successfully updated the database";
})
}
}])
angular.mod