Hi Luís,

How you doing ?

I solved the problem just using the promises that $http returns.
Thanks for the help.

On Wednesday, January 13, 2016 at 10:08:29 AM UTC-2, Luís Loureiro wrote:
>
> Hi Guilherme!
>
> Yes, you'll have to use promises.
>
> To do an HTTP POST you can use a service like *$http*.
> Like it's said in the docs, the functions that generate the HTTP request 
> return an HTTP promise, you should use that promise and assign it some 
> callbacks that verify the response.
>
> Here's an example:
> CheckoutService.canBuy()
>   .success(function (data) {
>     // Check if user can buy a thing or not.
>   })
>   .error(function (data) {
>     console.alert('Error');
>   });
>
> Hope this helps you.
>
> Regards,
> *Luís Loureiro*
>

-- 
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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to