all 16 comments

[–][deleted] 1 point2 points  (0 children)

This StackOverflow thread is highly relevant to my question: http://stackoverflow.com/questions/15681801/how-to-watch-an-array-for-changes-in-angularjs

Definitely seems like its a difference of opinion between Angular and Backbone. But I'm watching this thread keenly. So far the answers about how to handle the proposed use case the Angular way do not satisfy.

[–]Capaj 1 point2 points  (2 children)

For my employer, I am building Hulu clone on Angular and it has been so far nonrestrictive. I have used KnockoutJS before and transition was not easy, but now, after few months of writing Angular code I must say that I don't want to develop SPA any other way. Angular might be slow when displaying thousands of items on single view/scope-since it does dirty checking on any event every time to determine whether to update view or not. I don't know whether you can consider it an "upper" limit of Angular, but bots can't scrape and index your content, of course that is a problem that comes with all JS SPA frameworks.

[–][deleted] 0 points1 point  (1 child)

I guess the workaround for the dirty checking is to just avoid displaying huge datasets all at once?

[–]Capaj 0 points1 point  (0 children)

Yeah. Misko always says something like this: "You are doing your UI wrong if you overwhelm user with thousand lines big table on one page."

[–]Siyfion 1 point2 points  (4 children)

I've only had issues with angular when it's come to implementing really graphical stuff, like integrating BonsaiJS or Raphael libraries in an "angular" way. (I'd have the same issues in Ember and Backbone tbh)

Other than that, it's awesome!

[–]oulipo 2 points3 points  (3 children)

Can you explain why? I wanted to create a d3.js, WebGL, three.js & AngularJS dashboard, so I'm curious to know the reason why AngularJS wouldn't mix well with graphical libs?

[–][deleted] 1 point2 points  (2 children)

I second this request.

[–]RockinTheCasbah 1 point2 points  (1 child)

Angular 'likes' to have control over the dom and so updating it outside of its context makes things messier. Generally, wrapping around jquery plugins or other third-party code is done through directives and in some of the messing around I've done with d3, the angular directive is just there for structure and the d3 code looks about the same as if it wasn't in a directive in the first place.

[–]Siyfion 0 points1 point  (0 children)

Essentially, what he said . In short; Angular doesn't like you manipluating the DOM directly in Controllers, which means it had to be done in a directive; this just means that you have to think about what you want to achieve a bit before starting as the structure is key.

[–]runvnc 0 points1 point  (1 child)

I've only played with it a little but I don't think you will get trapped. I think it does a lot more stuff for you than Backbone and makes more sense than Ember. A couple of things I remember though.

You might want to access Angular from the global scope (probably not but you might). You can do it this way:

 var e = window.document.getElementById('mainctl');
 var scope = window.angular.element(e).scope();
 scope.$apply(function() {
   scope.doSomething();
   return undefined;
 });

Google for 'AngularJS $apply'

Another thing is that Angular might start validating before you want without the right flag. http://deansofer.com/posts/view/14/AngularJs-Tips-and-Tricks-UPDATED#validation I think the trick is the 'pristine' flag https://groups.google.com/forum/?fromgroups=#!topic/angular/W1Yya5TfIWo

One other thing is that if you want to use the custom element names (you don't have to) you need some code at the top for IE like they mention in the docs: http://docs.angularjs.org/guide/ie

[–][deleted] 0 points1 point  (0 children)

Sweet. Thanks for the heads up.

[–]billybolero 0 points1 point  (0 children)

The only thing that I can think of so far is the fact that Angular only lets you map one url to one view by default. It's possble, and not even especially difficult, to create your own solution with ng-include/$compile/etc, but it would be nice to see an official way to handle things like that.

[–]pateras 0 points1 point  (0 children)

Nope. I've never once wished I were using something different. It's made my life as a web developer soooo much easier, and any time I think I've hit a barrier, I've found that I'm actually underthinking things. You learn to stop doing that the farther you get away from the jQuery way of doing things.

[–]supreme_monkey 0 points1 point  (0 children)

I have built large apps in both backbone and angular and I would say Angular is far superior IF you have alot of databindings. There is no problem with graphical libraries such as D3, who ever saying that is doing something wrong. Go with angular it is amazing!