Ember data dependent keys undefined

前端 未结 1 390
难免孤独
难免孤独 2021-01-25 20:37

A lot of the other posts on this topic are 2+ years old, so here goes a potentially simple question.

I am using Ember data relationships to have a \'bizinfo\' record bel

相关标签:
1条回答
  • findRecord will return a promise. A simple way to get around the issue is

    model(params){
      return this.store.findRecord('user', this.get('user_id')) .
        then(ownedBy => this.store.createRecord('bizinfo', {ownedBy});
    }
    

    This will wait for the findRecord to resolve, then return a new record with the resolved value as the ownedBy property.

    0 讨论(0)
提交回复
热议问题