Yeah, I can just do 

location.href = 'index.cfm?action=encounter.search';

for a redirect, but I'm really trying to figure out how to submit a form to 
a new page.  I'm surprised it feels so difficult.



On Monday, August 11, 2014 10:48:21 AM UTC-7, Robert Zehnder wrote:
>
> Have you thought about using $location.url()/document.location  to move to 
> the next page after authentication is successful?
>
> On Sunday, August 10, 2014 3:48:23 PM UTC-4, Jonathan Price wrote:
>>
>> 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.

Reply via email to