AngularJS vs KnockoutJS

4,433 views
Skip to first unread message

Gian Marco Gherardi

unread,
Dec 27, 2011, 7:10:45 AM12/27/11
to ang...@googlegroups.com
Hi all,

i'm evaluating AngularJS for one project, and by searching on the net for infos and examples i found another library that seems very close in goals to angular:


Wonder how the two libraries compare and what are strength/weakness of one compared to the other.

Thanks!

David Yu

unread,
Dec 27, 2011, 11:10:11 AM12/27/11
to ang...@googlegroups.com
The way events from bindings are dispatched. If I'm not mistaken:
ko = listener per binding.
ng = scope (loops until all bindings within scope are handled ... scales well for larger apps)

Thanks!

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/wLwdBhGEiQcJ.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.



--
When the cat is away, the mouse is alone.
- David Yu

Dan Doyon

unread,
Dec 27, 2011, 12:07:00 PM12/27/11
to ang...@googlegroups.com
You might want to take a look at the todo examples found below. A todo app is done in a number of js mvc frameworks. Angular and Knockout are just two of the many.

https://github.com/addyosmani/todomvc

--dan

Christoph Burgdorf

unread,
Dec 27, 2011, 5:37:21 PM12/27/11
to ang...@googlegroups.com
Angular provides far more guidance than knockoutjs does. That's why I left Knockout. Inter-ViewModel-Communication, Routing, Validation, Dependency Injection...ko has no built in answer to those questions. I'm not trying to bash ko, I like it but Angular just feels more complete.

Gian Marco Gherardi

unread,
Dec 29, 2011, 3:24:34 PM12/29/11
to ang...@googlegroups.com
Yes, seems that Knockout is focused on "just" model-to-view data binding and leaves everything else to other libraries.

You mentioned "Inter-ViewModel-Communication": can you point me to some docs regarding this aspect of AngularJS?

Christoph Burgdorf

unread,
Dec 30, 2011, 2:35:54 AM12/30/11
to ang...@googlegroups.com
Depends on what this means to you. I was a bit vague with this point. So let me clear thinks up. First of all, I'm not sure how KO handles such scenarios these days but when I left it, things like binding a VM to the body element and switching between multiple VMs was kinda hard.

That's really is with AngularJS!

The live example:
http://cburgdorf.github.com/angular-todo-app/

A clean body with Templates/VM getting bound to it dynamically:
https://github.com/cburgdorf/angular-todo-app/blob/master/app/index.html

You can rely on the routing to manage that for you. Just specify the template and the VM to be mapped inside the body, depending on the current route:
https://github.com/cburgdorf/angular-todo-app/blob/master/app/js/services.js

That's part of what I had in mind with this point. I ment switching from one *independent* VM to another without each knowing the other.

But chances are high that you mean it in another sense. So, you might be interested in this thread which discusses how to leverage shared services to share state between VMs:

https://groups.google.com/forum/m/#!topic/angular/DlcI466OAvk

Hope it helps,

Christoph

https://groups.google.com/forum/m/#!topic/angular/DlcI466OAvk

Reply all
Reply to author
Forward
0 new messages