Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Specifing routes model example for emberjs website" />
<script src="http://code.jquery.com/jquery.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <script type="text/x-handlebars" data-template-name="photos">
    {{#each}}
      <h1>{{title}}</h1>
      <img {{bindAttr src=url}}>
    {{/each}}
  </script>
</body>
</html>
 
App = Ember.Application.create();
App.Router.map(function() {
  this.resource('photos');
});
App.PhotosRoute = Ember.Route.extend({
  model: function() {
    return [{
      title: "Tomster",
      url: "http://emberjs.com/images/about/ember-productivity-sm.png"
    }, {
      title: "Eiffel Tower",
      url: "http://emberjs.com/images/about/ember-structure-sm.png"
    }];
  }
});
App.IndexRoute = Ember.Route.extend({
  redirect: function() {
    this.transitionTo('photos');
  }
});
Output

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

Dismiss x