AngularJs $http Promise Tutorial

Поділитися
Вставка
  • Опубліковано 9 січ 2025

КОМЕНТАРІ • 37

  • @boot-strapper
    @boot-strapper 9 років тому +1

    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!

    • @JeremyStover
      @JeremyStover  9 років тому

      Chlorophant Not a problem at all! My work load has been very heavy for the last few months, but I do have a couple new tutorial ideas in the works. Go ahead and sub if you haven't already, and I will make sure you get a bunch more good videos! :)

    • @boot-strapper
      @boot-strapper 9 років тому

      Jeremy Stover Sounds good! I'm loving angular so far. I can never go back to jquery!

    • @JeremyStover
      @JeremyStover  9 років тому

      I feel the same way ☺ have a github?

    • @boot-strapper
      @boot-strapper 9 років тому

      I do, but most of my projects arent on there, since I use gitlab at work. :\

  • @simonliang6867
    @simonliang6867 8 років тому +1

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

  • @DonaldSubert
    @DonaldSubert 8 років тому

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

  • @IconicProps
    @IconicProps 9 років тому +1

    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.

    • @JeremyStover
      @JeremyStover  9 років тому +1

      +Mike Mason No problem! :D Always super happy to hear that people are actually being helped by my work.

  • @IconicProps
    @IconicProps 9 років тому

    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.

    • @JeremyStover
      @JeremyStover  9 років тому

      +Mike Mason Especially with short lived applications, where you are only browsing for max 10 minutes at a time, just pushing and popping will work just fine. But if you are building a social application(or other rapidly updating apps), make sure you explore some techniques with socket events, and the like. If you make something cool, I would love to see it!

  • @JeremyStover
    @JeremyStover  10 років тому +2

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

  • @rsdntevl
    @rsdntevl 9 років тому

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

    • @JeremyStover
      @JeremyStover  9 років тому

      +rsdntevl I am trying to find the time to make some. Sadly, other side projects have been taking a good chunk of the time it would take to make one of these videos. If you have any ideas on topics, I would love to hear them!

  • @ChristosChris3490
    @ChristosChris3490 9 років тому

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

    • @JeremyStover
      @JeremyStover  9 років тому

      +Chris Lilitsas Yeah, I learned that after building a blazing fast Imgur clone. I need to do an update on the video, but I have been super busy with another project. ;(

  • @WaleedElMelegy
    @WaleedElMelegy 9 років тому +1

    thank you jeremy.. it was helpful for me

    • @JeremyStover
      @JeremyStover  9 років тому +1

      Waleed El-Melegy No problem! I am finally working on a new tutorial based on $resource, and proper 'service' 'controller' 'factory' separation for large projects.

    • @WaleedElMelegy
      @WaleedElMelegy 9 років тому

      greate :)

  • @peelim
    @peelim 9 років тому

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

  • @JeremyStover
    @JeremyStover  10 років тому

    Learn how to build dynamic web sites with AngularJS!

  • @anuragmalhotra1883
    @anuragmalhotra1883 9 років тому

    very Helpful.. nice tutorial.. :)

  • @raffaellafico7652
    @raffaellafico7652 7 років тому +1

    Thank you Jeremy

  • @vamsideepakampolu
    @vamsideepakampolu 10 років тому +1

    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.

  • @RafaelVentura
    @RafaelVentura 10 років тому +1

    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.

    • @JeremyStover
      @JeremyStover  10 років тому

      I have been using angular for quite a while and I have been through the terrible scoping issues and the amount of quality tutorials on the web are amazing. After a bit, you know what works and what breaks. And the real issue turns into building something that can scale and be modified without easily.

    • @edlmiranda
      @edlmiranda 9 років тому +1

      Also, Angular comes with unit testing and e2e testing.docs.angularjs.org/guide/unit-testing

    • @JeremyStover
      @JeremyStover  9 років тому +1

      Eduardo La Hoz I write a ton of code day to day, and it is sad to say that while I know the syntax of Karma, I very rarely know how and when to test certain functionality.

    • @edlmiranda
      @edlmiranda 9 років тому +1

      Jeremy Stover I hear ya, dude. . In fast paced corporate environments it becomes very hard to employ any kind of reliable testing environments.

    • @JeremyStover
      @JeremyStover  9 років тому

      Yeah. Though I am interested in seeing how other developers write tests, and testable code. Care to have a chat about it?

  • @crlshn
    @crlshn 9 років тому +2

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

    • @JeremyStover
      @JeremyStover  9 років тому

      ***** Yeah, on my new set of videos, I am spending a lot of time editing out all of that stuff. Learned that I should create a git repository as I go and commit for every section of the video, so if I need to rerecord anything, I can just check back out to that commit.
      Thanks for the comment though! Keep them coming!

  • @kunzhiyoutuification
    @kunzhiyoutuification 9 років тому

    could you give me the code

  • @awbelton
    @awbelton 9 років тому

    You sound like John Malkovich

    • @JeremyStover
      @JeremyStover  9 років тому

      +Anthony Belton That's actually the anthropomorphic mole on my back talking. He looks like John Malkovich as well. :P

  • @ymaais
    @ymaais 8 років тому

    are u complicating things a bit?