The Code Below Works Perfectly fine when i run it in browser. But when the same code is placed in ionic specific code. it doesn't Can you guys help me through it. Thanks in Advace.
<div ng-app="myapp" ng-controller="empcontroller">
<form>
<input type="text" ng-model="empno">
<input type="text" ng-model="empname">
<input type="button" value="submit" ng-click="insertdata()" />
</form>
<script>
var app = angular.module('myapp',[]);
app.controller('empcontroller',function($scope,$http){
$scope.insertdata=function(){
$http.post("localhost/Angular/insert.php",{
'empno' : $scope.empno, 'empname' : $scope.empname
}).sucess(function(data,status,headers,config)
{
console.log("Data inserted Sucessfully");
});
}
});
</script>

