K
K
Kir ---2014-04-02 13:48:13
JavaScript
Kir ---, 2014-04-02 13:48:13

What are the advantages of AngularJS vs KnockoutJS?

For a long time I analyzed TodoMVC for these two libraries, as well as their lessons, and came to the conclusion that Knockout is much easier to learn and the code is much clearer.
Please tell me examples of applications where AngularJS reveals its advantages. So far, everything I've seen speaks against AngularJS.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lega, 2014-04-02
@SowingSadness

And in terms of performance, it is inferior:

There is another test that shows the opposite: plnkr.co/edit/leZaT043Yffz4LfG8Ykq?p=preview
I switched from Knockout.js to Angular.js (and then to Angular Light), here are some disadvantages of the first:
1) ng has declarative binding , not in ko (it was not before), although I recently came across some solutions.
2) Due to the fact that in the angular dirty check - you do not need to wrap the data in an observable, this is very convenient.
3) In ng, you can easily operate on data (large calculations), in ko, for this you need to get data from observable, perform operations, then put it back.
4) Also in ko there is an "instant" update, which brings 2 troubles: 1) load, you may not need to update right now 2) sometimes you need to consider the order of updating data, dependent calculations can break.
5) There is still not a small nuisance when in a large project you need to make a revision - and you need to make an ordinary variable as observable - it forces you to refactor, or vice versa, transfer from observable to normal for optimization, this problem is not in angular.
You can also look at Angular Light , it's simpler, + there are some useful features that are not in Angular.js

D
Damir Makhmutov, 2014-04-02
@doodoo

The difference is that KO by its philosophy is not suitable for large SPA applications. Why ? Because everything is done there through eval. This implies a high probability of memory leaks. It has much less features out of the box.
Angular works a little differently. It is more suitable for large SPA applications, more features out of the box, more likely to make a quality application.
And yet, google more, and you will find answers to all questions :-)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question