Ember.js array as model's property

前端 未结 3 915
我寻月下人不归
我寻月下人不归 2021-02-07 05:55

Cheers! I have some model, and one attribute of it is an array, but for some reasons (I use mongoDB on the server and it\'s problem with embedded models and ember-data) I can\'t

3条回答
  •  借酒劲吻你
    2021-02-07 06:30

    For those, who have the same problem as me: check out this answer:

    https://stackoverflow.com/a/13884238/1662820

    Or you can pass embedded models with hasMany relation and set custom primary key for embedded model in the adapter ('number' in my case). Look at this tests:

    https://github.com/emberjs/data/blob/master/packages/ember-data/tests/integration/embedded/embedded_without_ids_test.js

提交回复
热议问题