4 ms·
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 equiva
by ilyabraude 13y ago
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 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.
- ConceitedCode 13y agoI 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.
- s1kx 13y agoTheoretically 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.
- arianvanp 13y agoCould you elaborate why it's the achilles' heel? I'm exploring AngularJS right now, and am interested in its pitfalls
- skore 13y agoThen you may be interested in checking out Restangular: https://github.com/mgonto/restangular https://github.com/mgonto/restangular
- dreame4 13y agoI'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.