I’m very new to ember as my last post shows. But I’m getting more and more familiar with it.
We are using Ember-Cli and I’m wondering what is the best way to store functionality which is needed throughout the whole app.
Specifically I have an object which calculates all the permissions in our app. Right now I just do an ES6 import at every file which needs this permission object. But somehow it does not feel super smart. Is it better to use some kind of dependency injection? (I’m not very familiar with Ember dependency injection).
What makes this quite tricky is, that I have to fetch the roles asynchronously from the backend and then store this roles in the permissions object. Right now I initialize this permission object in the application route. I’m also not sure if this is the best place.
Nevertheless this solution is working right now but I think I should refactor it to accomplish a more “Ember”-way of accomplishing this. I’m looking forward to here some design advices from you guys
Thanks a lot Tschoartschi