@tsteuwer wrote:
So here's my scenario:
- I load the route, and generate a model.
- I need to check that model to see if it has certain properties, if it does I need to: -- Request more information.
However, during the
init
function of the controller, I dothis.get('model')
and it always returnsnull
.Is there an event im supposed to listen to after the model's been set on the controller? I'm not finding anything anywhere
import Ember from 'ember'; import { task } from 'ember-concurrency'; export default Ember.Controller.extend({ actions: { setSort(type) { this.set('model.sortBy', [type, 'rank:asc']); } }, init: function(...args) { this._super.apply(this, args); console.log(this.model); // This is NULL console.log(this.get('model')); // This is NULL console.log(this.get('currentModel')); // This is UNDEFINED }, requestDataTask: task(function* () { yield console.log('dostuff here'); }).maxConcurrency(3) });
Posts: 3
Participants: 2