Javascript Frameworks

I'm trying to figure out decisively what the uses are for Javascript frameworks such as Angular and Ember in regards to Rails. My immediate reaction to them was that it's an extra step that's being added and clogging up the code of the application, but that's a rather biased view considering I've never used one much less really comprehend their use.

The other point I'm trying to figure out is if we're writing all this code and using Rails as a front end for all of this, then why don't we skip a step and go to node.js for it?

Again, I'm new to the concept of these frameworks, so I'm not sure exactly what to think.

Hi

These JavaScript framework is use for front end code, and the Logic of apps will be in the front end, processed and rendered in the client side eg. The browser.

The front end then will consume The data provided via REST api service by the backend, can be Rails or use nodejs with async processing capability.

These frameworks make the handling of DOM in browser more convinience and advanced, in angular there are 2 way data binding.

And for mobile apps , this is usefull as the front end can use the local resource for processing the rendering of apps, and light dan loading AS only fetch the data needed by user by easier ajax handling provided by the JavaScript framework .

Also for the backend server, AS Rails no need to process the template rendering, just handle the data persistance.

For using node as the backend, it's back to you AS developer. Will you invest Time to Dive into nodejs while you have Rails in your daily routine.

Thats what i think about the JavaScript framework like angular.

Mulianto

Brandon W. wrote in post #1110341:

I'm trying to figure out decisively what the uses are for Javascript frameworks such as Angular and Ember in regards to Rails. My immediate reaction to them was that it's an extra step that's being added and clogging up the code of the application, but that's a rather biased view considering I've never used one much less really comprehend their use.

I wouldn't call your view of them biased, but rather a complete misunderstanding of what these frameworks are, and the problem they are designed to solve.

The other point I'm trying to figure out is if we're writing all this code and using Rails as a front end for all of this, then why don't we skip a step and go to node.js for it?

You have missed the fundamental point to these frameworks. Rails is actually being used here as a back-end to support a front-end written in Angular or Ember.

Think of these as Model-View-Controller for your client-side JavaScript. While these frameworks may take very different approaches to the problem these are designed to solve the same problem. Which it basically to add structure to your client side code the way Rails adds structure to your server side code.

Node.js has nothing to do with any of your points. Node.js is JavaScript running on the server. It makes no difference to Angular and Ember whether its data (model) is delivered from the server by Ruby, JavaScript or whatever.

Again, I'm new to the concept of these frameworks, so I'm not sure exactly what to think.

If you're really interested in knowing more about these JavaScript frameworks why don't you at least take a few minutes to actually read the overviews on their respective web sites and try to understand what they actually are:

http://backbonejs.org