Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta name="description" content="Facebook React vs Ember: An Application" />
  <meta charset="utf-8">
  <title>Facebook React vs Ember</title>
</head>
<body>
  
  <script type="text/x-handlebars">
    <div>
      <h3>TODO</h3>
      <ul>
      {{#each content}}
        <li>{{this}}</li>
      {{/each}}
      </ul>
    
      <form {{action "handleSubmit" on="submit"}}>
        {{input value=text}}
        <button type="submit">{{btnLabel}}</button>
      </form>
    </div>
  </script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  <script src="http://builds.emberjs.com/handlebars-1.0.0.js"></script>
  <script src="http://builds.emberjs.com/tags/v1.0.0/ember.min.js"></script>
</body>
</html>
 
var App = Ember.Application.create();
App.ApplicationController = Em.ArrayController.extend({
  content: function() {
    return [];
  }.property(),
  
  btnLabel: function() {
    return "Add #" + (this.get('content.length') + 1);
  }.property('content.length'),
  
  actions: {
    handleSubmit: function() {
      this.get('content').pushObject(this.get('text'));
      this.set('text', '');
    }
  }
});
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
cavnebpro
0viewers