Reputation: 305
if you look at the code below (JSBin created here) you'll see that when I type in the search box the computedValue
and aliasedValue
properties should get updated but don't.
Component JS
App.SearchComponent = Ember.Component.extend({
search: 'initial',
aliasedValue: Ember.computed.alias('search'),
computedValue: function(){
return 'computedValue';
}.property('search')
});
Component Template
{input value=search}}<br>
search: {{search}}<br>
computedValue: {{computedValue}}<br>
aliasedValue: {{aliasedValue}}<br>
I've done the exact same thing in a module format using Ember App Kit and it works fine. It's just in this context here of using the App
global that I can't get it to work.
Am I missing something really simple here but can't figure it out?
Thanks, Pat
Upvotes: 2
Views: 80
Reputation: 47367
components should be dasherized, so {{do-it}} would be matched up to
App.DoItComponent
in your case {{search-component}} would be mapped up to
App.SearchComponentComponent
So it's mapping it up to an Empty component, which is why nothing was working
http://emberjs.jsbin.com/vuzozobu/1/edit
Upvotes: 2