@tellsun2019 wrote:
I have a couple of models.
From the user model is to possible to fetch just the name model?
Basically I want to generate this call in the router.
/users/id/names
i checked a few online references, but couldn’t spot one for this specific case.
appreciate any help!
model abstraction
user model. user has many names
import Model, {hasMany} from '@ember-data/model'; export default class UserModel extends Model { @hasMany('names') names; }
name model
import Model, {belongsTo} from '@ember-data/model'; export default class UserModel extends Model { @belongsTo('user') user; }
Posts: 3
Participants: 2