Hacker Newsnew | comments | show | ask | jobs | submit login

I've been using Angular recently and love it. But this example is not matched evenly with the modular component demonstration of the React tutorial.

The equivalent in Angular would be to use directives (http://docs.angularjs.org/guide/directive) for the comment list, each comment, and each part of a comment.

Passing data between parent and child components (via scope) becomes a little tricky.




I am relatively new to Angular, but wouldn't you want to have the comments be a Factory using ngResource? If the comments are restful then it seems much easier.

-----


Theoretically yes, but ngResource is kind of the achilles' heel of AngularJS right now. You're often better off using a different library or making your own class with $http requests.

-----


I'm using AngularJS 1.1.5 and ngResource in my project and it works quite nice. I wouldn't discourage people from learning the hard way. However, +1 for Restangular.

-----


Could you elaborate why it's the achilles' heel? I'm exploring AngularJS right now, and am interested in its pitfalls

-----


Then you may be interested in checking out Restangular: https://github.com/mgonto/restangular

-----




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: