Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.rc.2/handlebars.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ember.js/1.0.0-pre.4/ember.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
  
</body>
</html>
 
App = Ember.Application.create({});
App.TopObject = Ember.Object.extend({
       subObject: Ember.Object.create({
           prop: ''
       }),
  
  dynamicProperty: function(){
    console.log("Computed Property");
    console.log("___"+this.get('subObject.prop')+"___");
  }.property('subObject.prop')
});
var topObjectInstance = App.TopObject.create({subOject: {prop: 'value'}});
topObjectInstance.get('dynamicProperty');
topObjectInstance.set('subObject.prop','Matchy');
topObjectInstance.get('dynamicProperty');
var subObj = topObjectInstance.get('subObject');
subObj.set('prop','Tom');
topObjectInstance.get('dynamicProperty');
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers