When comparing Knockout vs Angular, the Slant community recommends Angular for most people. In the question“What are the best React.js alternatives?” Angular is ranked 7th while Knockout is ranked 10th. The most important reason people chose Angular is:
Very good CLI and webpack, bundling, testing, deployment support. Deep TypeScript integration and support.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Easy data binding
Knockout uses HTML5 data attributes to bind HTML elements to data objects in javascript. This allows more work to be done by the framework rather than requiring you to specify where data should be bound in the javascript. The data binding is very intuitive as the bindings are done within the HTML itself in the location it should be bound.
Pro Easy to learn
Has a low entry barrier and an easy learning curve. It's especially easy to learn for beginners.
Pro Built in templating
Bindings in Knockout can also be used to control the generated structure of the HTML. There are bindings provided to allow for iteration and conditionals. The structure of the html reflects the structure of the data so iterative elements are bound to arrays in the data model. Having the HTML structure maintained by bindings keeps the templating simple, easy to read, and maintain.
Knockout also allows for string based templating so you can use whatever templating library you prefer.
Pro Legacy browser support
Supports a large number of browsers, including IE6.
Pro Great documentation
The excellent tutorials with built-in exercises are a great learning experience, even for people without prior MVVM and data binding experience.
Pro Lightweight and plays nicely with other libraries
Pro Dynamic models help with keeping the code simple and clean
Models in Knockout can be watched to keep the page data up to date by using observable objects. The observables notify Knockout when data is changed and automatically updates the page when this happens. By having Knockout maintain this relation, it keeps the front end code cleaner and simpler, and by enforcing a consistent pattern with observables the methodology can be more robust.
Pro Very flexible
One can do a lot of things and it keeps self references and other types of loops under control.
Pro It's only a library
Knockout does one thing, and does it well. It doesn't try to take on more than one area. It does MVVM data binding and that is it.
Pro Simple manageable modules
Using components is a great way of breaking up large modules into simpler ones.
Pro Great tooling and language support
Very good CLI and webpack, bundling, testing, deployment support. Deep TypeScript integration and support.
Cons
Con Slower than others when amount of objects grows
Knockout has a bad performance when the dealing with large amount of objects. You can see more here.
Con Can become complex once the application grows large
Knockout leaves the application structure to the developer and it can become quite complex and unmanageable in the hands of a beginner once the application grows large and complex.
Con Two way binding requires a little extra work
When allowing users to edit existing data, the two-way binding of observables means you'll need to have to save original values before they're edited, to make comparisons or revert if the user cancels the action.
Con Slightly over-engineered
Very enterprisey - made for huge architectures and with tons of declarative, non-intuitive annotations it makes it overkill for very small projects.
Con Native i18n support over-engineered
Not developer-friendly. Switching languages need reloading the whole page. There are third party solutions that work better.