I'm trying to make a progress bar that gets updated as more challenges are completed. However, the component cannot access the property because this is undefined.
I have injected a service and I'm trying to create a computed property from a property of the service. However, this is always undefined unless in debugging.
import Ember from 'ember'; export default Ember.Component.extend({ progress: 0, game: Ember.inject.service(), events: this.get("game.challenges") }); How can this be undefined in the above code? How is it not bound to any scope?
I've thrown in a debugger like this:
init() { debugger }, If I log out this.get("game") it returns the expected value.
I've also tried putting in the service inside of the init, still undefined. I've tried logging out this and that is undefined as well.
Is there a way to force the service to resolve before moving on? I have tried using various component hooks but they don't seem to have changed things.