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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -