|
* not useful in github (simple page with some js extras on top, it's a prime job for jquery) * for gmail you would use it to handle emails for example. Your view in gmail never changes, if you're looking at tags, or archive, or sent mails, or inbox, ... It's always the same thing, but the dataset changes; it comes from different sources, it is sorted and filtered different, ... For a Gmail clone with angular, you do you app/html/css one time, and then you only ever manipulate your model, everything else is done for you. Want to filter email to only get those tagged "hacker news" ? Map reduce your email set then assign it to your model, that's it - no dom no event assign no view logic no nothing, only data. Now, I'm pretty sure you read this and you think "but I could do the same with what I'm used to, just create a setEmailList(emails) function and use it", that is entirely true. Angular does not provide new functionnalities that you couldn't get otherwise. What angular provide is that 1 - it will be way faster to code than your "traditionnal" method once you're used to it, because angular does most of it for you, and 2 - large changes, special cases and thus evolution of the app are much easier to handle and code. It provide those two things by being made explicitely for them. Angular is so tailored for that use case that it sucks and should never be used for anything else. Don't be fooled by all the hype into thinking every website should now use angular/ember/whatever, they shouldn't. It does only one kind of job, but it does it very, very well. |