Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta name="description" content="Ember - Model FIXTURES" />
  <meta charset=utf-8 />
  <title>Ember - Model FIXTURES</title>
  <link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
  <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
  <script src="http://builds.emberjs.com/handlebars-1.0.0.js"></script>
  <script src="http://builds.emberjs.com/release/ember.js"></script>
  <script src="http://builds.emberjs.com/beta/ember-data.js"></script>
</head>
<body>
     <script type="text/x-handlebars" data-template-name="todos">
        <section id="todoapp">
          <header id="header">
            <h1>todos</h1>
            <input type="text" id="new-todo" placeholder="What needs to be done?" />
          </header>
          <section id="main">
              <ul id="todo-list">
              {{#each}}
                <li>
                  <input type="checkbox" class="toggle">
                  <label>{{title}}</label><button class="destroy"></button>
                </li>
              {{/each}}
            </ul>
            <input type="checkbox" id="toggle-all">
          </section>
          <footer id="footer">
            <span id="todo-count">
              <strong>2</strong> todos left
            </span>
            <ul id="filters">
              <li>
                <a href="all" class="selected">All</a>
              </li>
              <li>
                <a href="active">Active</a>
              </li>
              <li>
                <a href="completed">Completed</a>
              </li>
            </ul>
            <button id="clear-completed">
              Clear completed (1)
            </button>
          </footer>
        </section>
        <footer id="info">
          <p>Double-click to edit a todo</p>
        </footer>
    </script>
</body>
</html>
  
 
var Todos = Ember.Application.create();
Todos.ApplicationAdapter = DS.FixtureAdapter.extend();
Todos.Router.map(function () {
    this.resource('todos', { path: '/' });
});
Todos.TodosRoute = Ember.Route.extend({
    model: function () {
        return this.store.find('todo');
    }
});
Todos.Todo = DS.Model.extend({
    title: DS.attr('string'),
    isCompleted: DS.attr('boolean')
});
Todos.Todo.FIXTURES = [
 {
     id: 1,
     title: 'Learn Ember.js',
     isCompleted: true
 },
 {
     id: 2,
     title: '...',
     isCompleted: false
 },
 {
     id: 3,
     title: 'Profit!',
     isCompleted: false
 }
];
Output 300px

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

Dismiss x
public
Bin info
alex.daquinopro
0viewers