javascript - Ember.js Calling model's method from controller -
javascript - Ember.js Calling model's method from controller -
is there way hand on model controller? need phone call instance method defined on model ,
this.get(methodname)(params)    does not work, loses 'this' phone call context within called function.
thank you.
i'm not sure context want exist in method, if need switch context can utilize call/apply. context should context of method, not controller javascript standards.
var model = this.get('model');  model.methodname(arg1, arg2);    controller's context   model.methodname.apply(this, arrayofargs);  model.methodname.call(this, arg1, arg2);        javascript ember.js ember-controllers 
 
Comments
Post a Comment