by camus · 13y ago · 0 comments
AngularJS :
+ MVVM : databinding
+ Dependency Injection, so no global state, and loose coupling
+ Well organised into services , view models ,directives , filters , ...
- forget any projects that are animation/transition between views heavy, you'll fail
- doesnt play well with some other frameworks ( requireJS, jQuery mobile , even phonegap ...)
- is slow when dealing with a lot of data.
- no control over dom objects lifecycle
- the doc sucks
- if you dont understand Dependency injection , dont use it.
- will not scale if javascript dont get some new structures , dirtychecking is insane given javascript performances.
Ember: + fully event driven
+ plays well with other libraries
+ less magic than angular
+ full control over DOM lifecycle
- the doc sucks but less than angularJS one
- more verbose than AngularJS
- unstable API
I built apps in both langages. like that one :
I prefer Ember but have no problem using Angular when I have to.
Animation is coming to the next version. It's already possible but you have to do it yourself.
> doesnt play well with some other frameworks ( requireJS, jQuery mobile , even phonegap ...)
* https://github.com/tigbro/jquery-mobile-angular-adapter * http://briantford.com/blog/angular-phonegap.html
> is slow when dealing with a lot of data.
It's fast enough not to be noticeable by humans unless you're batman as explained by Angular creator: http://stackoverflow.com/questions/9682092/databinding-in-an... . Object.observe will make it fast even if you're batman.
> no control over dom objects lifecycle
There is control actually (see digest, apply etc).
> the doc sucks
The guides are actually pretty good and http://egghead.io/ free screencasts are awesome.
Edit: Google is going to sponsor the author of egghead.io videos! https://twitter.com/eggheadio/status/302494160982781953
> if you dont understand Dependency injection , dont use it.
You don't have to understand DI to use it. I know I didn't.
> will not scale if javascript dont get some new structures , dirtychecking is insane given javascript performances.
Again, read this http://stackoverflow.com/questions/9682092/databinding-in-an...
Additionally Object.observe will make Ember way of the data binding obsolete. So there will be another big Ember API change in near future.
Object.observe adoption for Angular apps will be transparent. Only the framework code will be updated. Maybe it is already updated.
LOL...me neither. I also don't get how someone could do anything beyond "Hello World" and not use DI as it seems to be pretty integral to how Angular works.
that's what i'm saying i should not need an adapter for these libraries , i dont need them with Ember or Backbone
We haven't found speed to be a problem yet. We used to use CanJS, and I can tell you that handling the same amount of data, Angular is faster, even with fairly complicated filters in place.
I do agree that Angular requires you to let go of the "jQuery way" of approaching DOM manipulation, which throws jQuery-coders for a loop. It's a downside not to be able to plop in a jQuery plugin. Then again, considering some of the plugins I've encountered, that might not be a complete loss. Also, the Angular-UI team is doing a heck of a job of replicating the most common plugins as Angular native directives.
Seeing as Ember just hit 1.0 RC, the API should now be pretty stable. It's been pretty bad the last few months though.
Also, with a stable API, the docs will hopefully see significant improvement.
Why? How is it different from using jQuery without Angular?