Live data from Hacker News

AngularJS Screencasts

egghead.io

31–40 of 42 posts

Re: AngularJS Screencasts

#31
I am pleasantly surprised with AngularJS's prowess. I've thrown some really dynamic and tricky stuff at it, and it has never failed. In the foreseeable future, I think I can take out jQuery from my app altogether.

I'm a self-taught developer, and the learning curve was steep. The to-do app, and Lindquist's videos made it significantly easy, though.

Re: AngularJS Screencasts

#32
post #14
post #10

Earlier quoted context omitted.

i believe there is an improve doc button. If you find AngularJS valuable , dont hesitate ;)

If the person can't understand how to use the thing, how would that person improve the documentation?

> but invaluable for anyone trying to get past...

he got past the do and "understood how to use the thing"

Re: AngularJS Screencasts

#33
All the introductory stuff for AngularJS I've seen so far is "client-side" - auto-updating bindings, the ToDo list etc.

Is there a similarly pitched tutorial about how to persist this back to a server, or how to write an API service that interacts best with the AngularJS model? Nothing in the list of video titles suggests that kind of help.

Re: AngularJS Screencasts

#34
Everyone keeps saying I should use Restangular instead of ngResource but so far I haven't seen any good reasons to. Anyone care to enlighten me?

Re: AngularJS Screencasts

#35
post #33

All the introductory stuff for AngularJS I've seen so far is "client-side" - auto-updating bindings, the ToDo list etc. Is there a similarly pitched tutorial about how to persist this back to a server, or how to write an API service that interacts best with the AngularJS model? Nothing in the list of video titles suggests that kind of help.

Angular is agnostic of the back-end. Just use the $http service to read/write async from the server. The angular model is whatever your model is - there are no restrictions

Re: AngularJS Screencasts

#36
post #33

All the introductory stuff for AngularJS I've seen so far is "client-side" - auto-updating bindings, the ToDo list etc. Is there a similarly pitched tutorial about how to persist this back to a server, or how to write an API service that interacts best with the AngularJS model? Nothing in the list of video titles suggests that kind of help.

Angular is agnostic of the back-end. Just use the $http service to read/write async from the server. The angular model is whatever your model is - there are no restrictions

I understand that, but an application isn't an island; presumably a server that speaks JSON is easiest to deal with, and there are probably a number of gotchas on "how best to build a backend that works the way AngularJS works well". I've not found anything like that yet and I'd love someone to point me to it.

Re: AngularJS Screencasts

#37
post #34

Everyone keeps saying I should use Restangular instead of ngResource but so far I haven't seen any good reasons to. Anyone care to enlighten me?

Heh.. I still don't know yet.

I'm building a fairly big Django/Angular project with ngResource and have been trying to replace it with Restangular, which has a nice API. But both have pros and cons:

What I like about ngResource is that returned data is automagically filled in as soon as the AJAX request completes. I can do this:

  function controller(Resource) {
    $scope.thing = Resource.get(); // here $scope.thing is an empty object, will be filled in as soon as data arrives

    $scope.do = function() { alert ($scope.thing.name); }
  }
Restangular returns promises instead, so to replicate the above code I'll have to do

  function controller(Restangular) {
    $scope.thing = Restangular.one('thing', 1).get();
    // $scope.thing is a promise, I can't directly access its members in the controller, but since angular templating has native support of promises, I can use {{thing.name}} there.

    $scope.do = function() {
      $scope.thing.then(function(thing) {
        alert(thing.name);
      }
    }
  }
-- or --

  function controller(Restangular) {
    // I think that's ugly
    Restangular.one('thing', 1).get().then(function(thing) {
      $scope.thing = thing;
    }

    // $scope.do will be the same as in the ngResource example
  }
Conclusion: Restangular has a nice API - but magically filling list/object is ngResource major selling point.

What I'd like from both is a nice getOrCreate method for elements, where it POSTs if the object doesn't have an ID set, otherwise sends a PUT. In CRUD forms I try to use the same controller for both "new" and "edit" actions, and I don't want to check the presence of ID and call the appropriate method every time.

Also, if Angular could handle REST data with a higher level library inspired by Ember.Data, I could die a happy programmer.

Re: AngularJS Screencasts

#38
post #33

All the introductory stuff for AngularJS I've seen so far is "client-side" - auto-updating bindings, the ToDo list etc. Is there a similarly pitched tutorial about how to persist this back to a server, or how to write an API service that interacts best with the AngularJS model? Nothing in the list of video titles suggests that kind of help.

I've run across a number of tutorials that persist through a simple PHP-based REST API. What I haven't seen, but would very much like to, is one that includes authentication.

Re: AngularJS Screencasts

#39
post #36

Earlier quoted context omitted.

Angular is agnostic of the back-end. Just use the $http service to read/write async from the server. The angular model is whatever your model is - there are no restrictions

I understand that, but an application isn't an island; presumably a server that speaks JSON is easiest to deal with, and there are probably a number of gotchas on "how best to build a backend that works the way AngularJS works well". I've not found anything like that yet and I'd love someone to point me to it.

OK I get you. The angular-app [1] is a full stack app with angular front-end, node back-end. It's not a walkthrough but you could certainly read through the code

[1] https://github.com/angular-app/angular-app

Re: AngularJS Screencasts

#40
post #27
post #15

I also found https://news.ycombinator.com/item?id=5839553 to be super useful for actually getting started with AngularJS with no experience. Then moving onto egghead.io tutorials.

In addition to the first three tutorials I just put out another cast on tuesday, here's the full updated list: * Part 1: Intro to Angular JS (50 minutes) [1] * Part 2: End to End with Angular JS (52 minutes) [2] * Part 3: Security with Angular JS (30 minutes) [3] * Part 4: Frontend Workflows with Grunt and Angular JS (~60 minutes) [4] [1] - http://www.youtube.com/watch?v=8ILQOFAgaXE [2] - http://www.youtube.com/watch…

These are amazing, have you considered authoring for something like Lynda.com ? Or make a site with lots of screencast, as a beginner I would pay to have good Angular JS video tutorials from an expert.
Post reply on HN