Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
  <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css">
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  <script src="http://momentjs.com/downloads/moment.min.js"></script>
  <script src="http://builds.emberjs.com/release/ember.prod.js"></script>
  <script src="http://builds.emberjs.com/release/ember-template-compiler.js"></script>
</head>
<body>
  <div id='app'></div>
  <pre id="logs"></pre>
  
  <script type="text/x-handlebars">
    <h2>rwjblue's Ember JSBins</h2>
     {{link-to 'Simple' 'simple'}} |
     {{link-to 'Complicated' 'complicated'}}
     <div>
    {{outlet}}
    </div>
  </script>
  
  <script type="text/x-handlebars" id="complicated">
    {{#each model as |item|}}
      <div>
        {{item.name}} - <input value={{item.time}} oninput={{action (mut item.time) value="target.value"}}>
      </div>
    {{/each}}
  </script>
  
  <script type="text/x-handlebars" id="simple">
    <h1>Nothing to see here</h1>
  </script>
  <script type="text/x-handlebars" id="index">
   Index Route
  </script>
</body>
</html>
 
/* Put your CSS here */
html, body {
    margin: 20px;
}
 
var App = Ember.Application.create({
  rootElement: '#app',
  LOG_RESOLVER: true
});
App.Router.map(function() {
  this.route('complicated');
  this.route('simple');
});
App.ApplicationRoute = Ember.Route.extend({
  actions: {
    error: function(error) {
      log(error.message);
    }
  }  
});
App.ComplicatedRoute = Ember.Route.extend({
  
  data: Ember.computed(function () {
    var data = [];
    for (var i = 0; i < 100; i++) {
      var item = {
        name: 'Item ' + i,
        time: new Date()
      };
      data.push(item);
    }
    return data;
  }),
  
  model: function() {
    return this.get('data');
  }
});
Ember.onerror = function(error) {
  log(error.stack);
};
function log() {
  var msg = [].slice.call(arguments).join(' ');
  logs.insertBefore(document.createTextNode("\n" + msg), logs.firstChild);
}
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers