I am working on an application where I am passing a property that is being observed in controller, to the component but I am getting undefined value. I am using ember 1.6
How I call component:-
Component implementation is:-
App.RangeSliderComponent = Ember.Component.extend({
tagName:'',
currentValue:function(){
return this.get('value');
}.property('value'),
minValue:function(){
return this.get('min');
}.property('min'),
didInsertElement:function(){
console.log("component with currentValue="+this.get("currentValue")+" minValue="+this.get('minValue'));
}
})
currentVal used as component value is a property being observed in controller. Whenever I slide the slider, the currentVal is changed as it is bound with the component. The default value is 50. Controller is working fine.
The controller part is:-
currentVal:50,
currentValChanged:function(){
console.log("currentVal changed");
}.observes('currentVal'),
In component, I am getting the min value correctly but not getting the value. It's coming undefined.
How to get the property value in component?
Aucun commentaire:
Enregistrer un commentaire