AngularJs $http Promise Tutorial

preview_player
Показать описание
Learn the proper way to use AngularJs' built in $http service, with a healthy dose of promises along the way. After this tutorial, you will be able to create real data driven websites with pre built Json APIs.

Рекомендации по теме
Комментарии
Автор

This is the most useful tutorial with $http and $q service!Thanks.

simonliang
Автор

This one of the best angular tutorials I have seen. There seems to be a large abundance of painfully simple tutorials but none that go the kind of depth needed for enterprise applications. This was very helpful. Thanks!

boot-strapper
Автор

I am very happy to have found this tutorial. It is one of the very best that I've ever seen.

DonaldSubert
Автор

By the way, this is a nice tutorial; well thought out and done. It is just what most people need to understand the basics of promise objects. Thanks for making it.

IconicProps
Автор

Drive data to your AngularJS application! Learn to build scalable applications that enable users to save and retrieve data.

JeremyStover
Автор

One thing I would note is that when I make a call to the server, like at 29:20 my server returns the object I added in the response back. I then just push() or pop() it to the results. This prevents me pulling all of the data back, and it only gets added on a success. If

This is especially useful to do when you have paged results or a lot of items in your list. One could argue that things could get out of sync, but with the server only returning the object on success it isnt likely. On fail I obviously do not add it. Also it is good practice to add the error catch after your then() functions. Your server may handle errors in the data, or even in your service, but if you do something wrong inside of the then() callbacks, and you error, you have no error handling. That is what the error catch is for at the end of a promise object.

IconicProps
Автор

amazing tutorial! love the clarity and modularity of the information. are there going to be more tutorials?

rsdntevl
Автор

Hi Jeremy !!! Your tutorial is very usefull. I have a request: Is it possible to use $resource for getting the TokenLogin by using Oauth2 ???

peelim
Автор

thank you jeremy.. it was helpful for me

WaleedElMelegy
Автор

The third message of then() function is often used to create a percentage(%) loader for the request

ChristosChris
Автор

Learn how to build dynamic web sites with AngularJS!

JeremyStover
Автор

Why not call .catch on the promise at the end of the chain to handle any uncaught errors, an error handler in .then handles the error from the previous then or from the initial promise, it wont handle the error from the success handler if there is any.
.catch handles both the error in the initial promise and any subsequent then success handler because the execution skips all the other then blocks and goes directly to the catch.

vamsideepakampolu
Автор

dude I was scared @31, 20 thinking "is he ok?, will (he) be able to complete the tutorial" add a suspense to the thanks btw.

crlshn
Автор

How can you code all this without checking if it works? I find Angular extremely prone to break, any minuscule change can catastrophically and silently crash the whole Angular side of the code.

RafaelVentura
join shbcf.ru