Emberjs – Function as variable in controller

Just put “Ember.computed()” around your function.

Example:

sessionsMeta: Ember.computed(function()
{
 this.store.query('session').then((result) => {
   let meta = result.get('meta');
   return meta;
 });
})