nah, I don't even think that's true. knockout does data-binding/components and that's about it. it isn't opinionated and can be dropped into any project, even for just a tiny piece of UI.
I haven't used angular myself, but my understanding is that it's extremely opinionated, and it can't just be dropped into a project to handle a small piece - either your project is an Angular project or it's not. it does a whole lot more than knockout.
As a Wordpress developer in my day job, I regularly toss in Angular to spruce up various components (both admin-side and public-facing) that are data-heavy. I think once you introduce routing that you're essentially defining your code as a single-page app, but up to that point it lives in its own happy little world as a child of whatever it runs in.
perhaps i haven't understood Angular that well then. if it really can be dropped into an existing project and live alongside your existing code well, then i'd say /u/strattonbrazil was right.
however, that makes me wonder - why not use Knockout for that purpose? It still seems to me better suited for handling data-binding outside of a SPA or a very large project.
why not use Knockout for that purpose? It still seems to me better suited for handling data-binding outside of a SPA or a very large project.
I think that's an opinion of which one you like better. Some people describe angular's binding as "magic"--some in a good way and others not. Knockout uses MVVMs while angular has these Model-View-Whatever's scopes, but both embed their "directives" in html, which makes them more similar in many respects than backbone or react, for instance. At that point I don't see how one is really better suited than the other besides not using all the features of angularjs, but I wouldn't hold that against angular. I've only built smaller snippets with angular and have really enjoyed knockout professionally and on personal projects, but I wouldn't say I've seen enough of angular to say confidently it shouldn't be used on small projects. I haven't seen anything that would say it wouldn't do fine on a small portion of a web page.
The honest answer is that I found Angular first. I enjoy its templating syntax and after taking the time to understand it found it enjoyable. If I had found Knockout first, the story may have been different.
7
u/d_abernathy89 Nov 05 '14
I like Knockout, but they are very different tools.