2

I am looking for a way to control large amounts of JavaScript code in a ASP.Net MVC web application.

I have been looking at Ember.js and whilst it's pretty compelling it takes control of the routing and as such treats the server as little more than a place from which to receive API calls. This isn't really useful for what I need.

I wondered if there recommendations for similar projects out there that allow faster, more structured, JavaScript but in traditional server-based web applications?

asked Apr 26, 2013 at 7:30

3 Answers 3

1

Take a look at knockout.js it is an MVVM library.Like most frameworks it does not have any routing.Rather it has a concept of observables.What this means is it can observe any DOM elements for changes and once detected it updates the UI automatically.This can take care of most of the DOM interaction that we do in single page applications like showing/hiding certain parts of UI based on user actions.

For me knockout.js has the cleanest syntax in javascript frameworks.All the bindings are done through html 5 data* attributes.

You might also want to check out this excellent article that compares the most popular javascript mvc frameworks.If you already have written lots of client side code and are considering migrating to knockout.js check out this question that I asked on stack overflow.The answer really helped me in finding an effective way to do this.

answered Apr 26, 2013 at 9:18
3
  • Angular can be used both with custom attributes or data-... attributes: github.com/angular/angular.js/blob/master/CHANGELOG.md#1.0.0rc1 Commented Apr 26, 2013 at 13:09
  • Ahh that's nice I did not know that. Commented Apr 26, 2013 at 13:32
  • 1
    Excellent answer, exactly what I was looking for. Cheers! Commented Apr 27, 2013 at 10:35
1

There are a whole bunch of various JavaScript frameworks.

You can find exemples of applications in there: http://todomvc.com/

And a nice comparison here: http://coding.smashingmagazine.com/2012/07/27/journey-through-the-javascript-mvc-jungle/

I personnally like Angular as it's more powerful then Knockout and lighter than Ember.

answered Apr 26, 2013 at 11:56
1
  • Doesn't Angular want to take control of routing though? Commented Apr 29, 2013 at 20:13
1

You can disable Ember's URL management. Read the guide http://emberjs.com/guides/configuring-ember/embedding-applications/ before you discard Ember. What's considered a structured web application on client-side is moving forward in a rapid and pleasant manner (i.e. Ember). That fact does also make Niphra's suggested article from Smashing Magazine outdated if you are evaluating Ember.

But Ember might still not be way to go for structuring large amounts of existing JavaScript code. Someone else might fill in on that subject.

answered Sep 19, 2013 at 14:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.