Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/canary/ember.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <script type="text/x-handlebars">
    {{render "foo" bar}}
    {{outlet}}
  </script>
  <script type="text/x-handlebars" data-template-name="foo">
    <h2>Hello {{controller.foobar}}!</h2>
    <h2>{{model.isBar}}</h2>
    <h2>{{model.notBar}}</h2>
    <h2>{{controller.isBar}}</h2>
    <h2>{{view.isBar}}</h2>
    <h2>{{isBar}}</h2>
  </script>
</body>
</html>
 
App = Ember.Application.create();
App.ApplicationController = Ember.Controller.extend({
  model:function(){ return Ember.Object.create({
    bar : Ember.Object.create({ isBar : 'good foo'})
  });
 }
});
App.FooController = Ember.Controller.extend({
 
     foobar : 'boom'
 
   , model  : function(o){
      return o? o : Ember.Object.create({ notBar : 'bad foo'});
      }
});
App.FooView = Ember.View.extend({
  templateName:'foo'
});
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers