I have this angular script
var app = angular.module('j_app', ['ngMaterial'], function($interpolateProvider) {
$interpolateProvider.startSymbol('<%');
$interpolateProvider.endSymbol('%>');
});
app.controller('j_controller', function($scope, $http) {
$scope.formdata = {};
$scope.formsubmit = function(){
$http({
method : 'POST',
url : '/dodong',
data : $.param($scope.formdata),
headers : {'Content-Type' : 'application/x-www-form-urlencoded'}
}).success(function(data){
console.log(data);
});
};
});
and this angular form
<body ng-app="j_app">
<div ng-controller="j_controller">
<form ng-submit="formsubmit()">
<fieldset>
<input type="text" name="username" ng-model="formdata.username" placeholder="Your username here..." />
<input type="password" name="password" ng-model="formdata.password" placeholder="Your password here..." />
</fieldset>
<button>Submit test angular</button>
</form>
</div>
</body>
but the form did not submit like nothing happen yet no errors thrown. Any ideas?
'Contnt-Type'isn't spelt correctly.<button ng-click="formsubmit()">Submit test angular</button>?