This is pretty basic, so my apologies if it's tiresome.
I've got a form declared as such:
<form
name="loginForm"
ng-controller="LoginController"
ng-submit="processForm()"
novalidate >
with a Controller defined like so:
app.controller('LoginController', ['$http', '$scope', function($http,
$scope){
$scope.formData = {};
// process the form
$scope.processForm = function() {
$http({
method: "post",
url: "index.cfm?action=api.login",
data: $.param($scope.formData),
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
.success(function(data, status, headers, config) {
return true;
})
.error(function(data) {
return false;
});
};
}]);
Everything works great. But what's the best method for sending the user on
to a new page at this point. I tried declaring the action in the form tag,
but I got a non-descript error from firebug. Is there a best-practice for
this?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.