I have following html page :
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>
<script src="scriptAssign.js"></script>
</head>
<body ng-app="myapp">
<div ng-controller="MyController">
<form ng-submit="submitForm()" method="POST">
ATTID :
<input type="text" name="firstName" ng-model="myForm.firstName">
<br/> Role :
<select ng-model="selectedRole" ng-options="myForm.roleName for myForm in role"></select>
<br/>
<input type="submit" id="submit" value="Submit" />
</form>
<div>
{{myForm.firstName}} {{selectedRole.roleName}}
</div>
</div>
<script>
</script>
</body>
</html>
My javascript file is as follows :
angular.module("myapp", [])
.controller("MyController", ['$scope', '$http', function($scope, $http) {
$scope.myForm = {};
$scope.role = [{ roleName :"A"},{roleName : "B"},{ roleName : "C"}];
$scope.submitForm = function() {
$http.post('/services/poc/add').success(function(data) {
$scope.myData = data;
});
}
}]);
i am getting error as
HTTP Status 400 - type Status report message description The request sent by the client was syntactically incorrect. Apache Tomcat/7.0.32
ng-model="selectedRole"tong-model="myForm.selectedRole"