Hi shivani,
You can redirect on success response.
Like this.router.navigate([redirecturl]);
Or
Window.location.href = redirecturl;

On Tue 22 Oct, 2019, 4:58 PM Shivani Shinde, <[email protected]>
wrote:

> Hi, I am completely new to angular. I need some help in following.
> I am uploading a file by calling an api using POST.
>   $scope.uploadFiles = function () {
>
>                 var request = {
>                     method: 'POST',
>                     url: 'my-url',
>
>                                            data: formdata,
>                     headers: {
>                         'Content-Type': 'multipart/form-data'
>
>                     }
>                   };
>
>                 // SEND THE FILES.
>                 $http(request)
>                     .success(function (d) {
>                         alert(d);
>                     })
>                     .error(function () {
>                     });
>             }
>
> In response *.success(function(d))*, I receive the html script of the
> page I *need to redirect to for google login*.(Screenshot of output is
> attached.) How can redirecting be achieved? How can that html response be
> handled?
>
> [image: Screenshot from 2019-10-22 12-58-30.png]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Angular and AngularJS discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/angular/50ec53d4-25bc-4f12-bcac-aa96c3777d20%40googlegroups.com
> <https://groups.google.com/d/msgid/angular/50ec53d4-25bc-4f12-bcac-aa96c3777d20%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/CA%2BQXFh7A-XuPVirnQ3sxEm4n_w%3DqMMpSnXB4xwCmO6X9Bo53-Q%40mail.gmail.com.

Reply via email to