The cookbook form examples on the AngularJS site only save the state on the client. How do I submit to the server?
Alternatively, how do I use jQuery\'s form.submi
Note, there is strict separation of view (your html template) and logic (your JS code) - mainly because of testability.
The right way is to just send your model to the server, using $resource (for REST) or low level $http. Instead of doing the job in the template.
Simple example - HTML template
First: <input type="text" ng-model="person.first" />
Last: <input type="text" ng-model="person.last" />
<button ng:click="save()">Save</button>
JavaScript - controller
function FormCntl($scope, $http) {
$scope.save = function() {
$http.put('/save.py', $scope.person);
};
}
As far as I know, there isn't really a good way to modify headers which angular sends to server expect for editing angular source. This is planned enhancement, but it's still not done.
I think that angular google group might be better place to ask specific questions like this since developers are really friendly and knowledgeable.