I'm doing
MyApp=Em.Application.create({ VERSION: "0.0.1" }); MyApp.president = Ember.Object.create({ firstName: "Barack", lastName: "Obama", fullName: function() { return this.get('firstName') + ' ' + this.get('lastName'); // Tell Ember that this computed property depends on firstName // and lastName }.property('firstName', 'lastName') }); var myView = Em.View.create({ templateName: "my-template", fullNameBinding:'MyApp.president.fullName', firstNameBinding:'MyApp.president.firstName' }); myView.appendTo(divToControl); MyApp.president.firstName='foo';//update via binding The template is just MyApp of {{firstName}} {{fullName}} But my div just contains MyApp of I don't see why the details aren't being filled in. I'm sure I missed an obvious step but I can't see what it is. Any pointers for debugging ? Or a second pair of eyes that can see the obvious mistake ? MyApp is a private variable inside the function that creates and appends the view. Tom |
I think you sent this email to the wrong mailing-list :)
Didn't you mean Ember instead of Amber? Cheers! Nico Tom Chiverton <[hidden email]> writes: > I'm doing > > MyApp=Em.Application.create({ > VERSION: "0.0.1" > > }); > > MyApp.president = Ember.Object.create({ > firstName: "Barack", > lastName: "Obama", > fullName: function() { > return this.get('firstName') + ' ' + this.get('lastName'); > // Tell Ember that this computed property depends on firstName > // and lastName > }.property('firstName', 'lastName') > }); > > var myView = Em.View.create({ > templateName: "my-template", > fullNameBinding:'MyApp.president.fullName', > firstNameBinding:'MyApp.president.firstName' > }); > myView.appendTo(divToControl); > > MyApp.president.firstName='foo';//update via binding > > The template is just > MyApp of {{firstName}} {{fullName}} > > But my div just contains > MyApp of > > I don't see why the details aren't being filled in. I'm sure I missed an > obvious step but I can't see what it is. > > Any pointers for debugging ? Or a second pair of eyes that can see the > obvious mistake ? > > MyApp is a private variable inside the function that creates and appends > the view. > > Tom |
Funny. I never expected this to happen.
Maybe Amber should be renamed to Smalltalk.js :) |
In reply to this post by Nicolas Petton
I did, oops :-)
On Friday, August 3, 2012 5:57:37 PM UTC+1, nicolas petton wrote: I think you sent this email to the wrong mailing-list :) |
Free forum by Nabble | Edit this page |