15

I am working in Asp.net MVC for last 1 year but I have never used AngularJs , BackboneJs or KnockoutJs . Now I want to use it in my project but I am little bit confuse that for MVC which is one is Best . Somewhere I read that AngularJs has best perfomance but mostly used with MVVM framework so kindly provide me proper guidance that with Asp.net MVC which js is best either AngularJs or BackboneJs or KnockoutJs ?

Thanks in Advance.

Dilip Langhanoja
  • 4,455
  • 4
  • 28
  • 37

4 Answers4

14

If you are building single page application you need a SPA framework. It should include two-way data-binding, client-side routing, page composition, navigation, screen state management, module system, bundling. You can choose between Angular and Durandal. They both provide very similar functionality, but in my opinion, Durandal is the most complete SPA framework, which is very easy to use. Both Durandal and Angular can be used with Breezejs to build data centric applications.

check Durandal, Durandal Auth and HotTowel Angular

If you are building ASP.NET MVC application, then all you need on the client side is two-way data binding to reduce DOM manipulations. In my opionion, it's an overkill to use angular just for data-binding. Backbone or Knockout are good choices, but Angular can be used as well.

Erikas Pliauksta
  • 1,402
  • 1
  • 14
  • 22
11

It depends on the nature of your application. And since you did not describe it in great detail, it is an impossible question to answer. I find Backbone to be the easiest, but I work in Angular all day. Performance is more up to the coder than the framework, in my opinion.

Are you doing heavy DOM manipulation? I would use jquery and backbone

Very data driven app? Angular with it's nice data binding

Game programming? none, direct to canvas, maybe a game engine - Source

Also, take a look at https://stackoverflow.com/questions/5112899/knockout-js-vs-backbone-js

You can check the following source. It's really complete:

http://www.infoq.com/research/top-javascript-mvc-frameworks

Personally, I'd go for Angular just because of its performance, but there are plenty of reasons...

Community
  • 1
  • 1
Nilesh Gajare
  • 6,302
  • 3
  • 42
  • 73
9

I'm using Knockout with ASP.NET MVC/Web API at work, but I have played with Angular at home and honestly prefer that. Bear in mind though that Knockout solves a much smaller problem than does Angular, the latter being a complete SPA framework (with services, HTML directives etc). To compare apples to apples, you should consider Knockout in tandem with Durandal, as this is a full-blown SPA framework like Angular.

From practical experience I suspect that memory leaks are easier to avoid with Angular than Knockout, since Knockout produces references implicitly as you subscribe to observables (typically via ko.computed) and we had a very hard time trying to track down such memory leaks due to undiciplined taking of Knockout subscriptions without cleaning up. With Angular I couldn't see that you have the same problem, as you don't subscribe directly to mutating variables ("observables"). Instead, the framework is in full control of applying model changes, which might be harder to grasp initially, but ultimately leads to better maintainability.

aknuds1
  • 65,625
  • 67
  • 195
  • 317
6

I have not tried knockout or backbone. With Angular I have worked with ASP.NET MVC. I personally did not like using MVC views. As Angular requires POJO (Plain Old JavaScript Objects) , So, I changed to Web Api and Angular. To be honest I am very satisfied with Angular because of following reasons:

  • DOM maniuplations are done where they belong.
  • Two way binding
  • Designed with unit testing
  • Services are where they belong
  • Designed with HTML5 in mind
  • Ability to create HTML markup to suit business needs (directives) and many more.
KrishnaDhungana
  • 2,604
  • 4
  • 25
  • 37