jax
jax

Reputation: 38633

Inject Ember.Controller model into Ember.Service

How can I access the "model" in an Ember.Controller from an Ember.Service? In my case I need the ember-data model in a url such as http://localhost:4200/users/4/groups. In a route I can simply do this.modelFor('users')

Upvotes: 0

Views: 92

Answers (1)

Ember Freak
Ember Freak

Reputation: 12872

You can not access the "model" in an Ember.Controller from an Ember.Service. You can only inject controller in another controller. You need to pass model data to Service method and get your work done.

Upvotes: 1

Related Questions