JS framework providing two-way binding with htmls mapping on server side?

Is there any JS framework that provides two-way binding with server side htmls mapping? Like Angular / Ember, but instead of rendering html on the client side only updates the server-side HTML page.

I like to keep html pages visible without JS and use JS to make them interactive. I'm using jQuery right now, but manually pulling and pushing data from and to view is cumbersome.

+4
source share
3 answers

We searched for this for a while and began to study rivets.js to do this.

On the server side, we:

  • render HTML with special prefix attributes that require rivets
  • send JSON for the models used on the page in <script> tags (aka bootstrapping)

On the client side we:

  • organize our code with Backbone
  • bind the boot model with a <div> , which contains a visualized representation of the model

Captures control bindings.

This is still pretty experimental, so I will update this answer when we better understand tradeoffs and performance.

+2
source

I can't talk to Amber, so I will respond as an active member of the AngularJS community.

Angular and Ember are mainly MVC client frameworks, so using them outside of this may not make much sense. For example, AngularJS provides leaps and bounds more than just two-way data binding.

Even if you earn it, it will be redundant. They are intended for creating web applications, not for web pages. I would say that JavaScript MVC frameworks are not suitable simply to “make [page] interactive”. In addition, jQuery already does this quite well, and you can use the template engine to do some data binding.

But I'm a big fan of AngularJS and MVC on the client side as a whole, so I would like to be a little more useful:

  • Can you give some insight into why you are looking at AngularJS and Ember?
  • What do you want to do that you cannot in jQuery?
  • Why do you want to enlarge a web page and not create more web applications?
+1
source

What you are looking for is a framework designed to use __ Progressive Enhancement

Ember.js and Angular take a completely different approach. Given your requirement to “save html pages without visible visibility without JS,” none of them would be a good choice. Of course, using jQuery is an option, but as you say, it can be cumbersome. It might be worth revising this requirement.

+1
source

All Articles