Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Ember Starting Point" />
<meta charset=utf-8 />
<title>Ember Starting Point</title>
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://builds.emberjs.com/handlebars-1.0.0.js"></script>
  <script src="http://builds.emberjs.com/ember-latest.js"></script>
</head>
<body>
  <script type="text/x-handlebars">
  <h1>App</h1>
  {{#linkTo index}}Index{{/linkTo}}
  {{#linkTo foo}}Foo{{/linkTo}}
  {{#linkTo bar}}Bar{{/linkTo}}
  {{outlet}}
</script>
  
  
  <script type="text/x-handlebars" data-template-name="index">
  <h2>Index</h2>
  {{#linkTo foo}}Go to Foo{{/linkTo}}
</script>
  
  
  <script type="text/x-handlebars" id="foo">
        <h2>Welcome to Foo!</h2>
</script>
  
  <script type="text/x-handlebars" id="bar">
        <h2>Welcome to Bar!</h2>
</script>
  
    
 <script type="text/x-handlebars" data-template-name="loading">
  <h1>Loading</h1>
</script>
  
</body>
</html>
 
App = Ember.Application.create({});
App.Router.map(function() {
  this.route('foo');
  this.route('bar');
});
App.FooRoute = Ember.Route.extend({
  model: function() {
    return new Ember.RSVP.Promise(function(resolve) {
      Ember.run.later(function() {
        resolve({ id: "woot", name: "Alex" });
      }, 2000);
    });
  }
});
App.BarRoute = Ember.Route.extend({
  model: function() {
    return new Ember.RSVP.Promise(function(resolve) {
      Ember.run.later(function() {
        resolve({ id: "borf", name: "Lexifer" });
      }, 2000);
    });
  }
});
App.LoadingRoute = Ember.Route.extend({});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers