ember-cli (2.4.3) not generating DS models

前端 未结 2 1069
时光取名叫无心
时光取名叫无心 2021-01-25 05:51

I am very surprised not to get DS models upon generating ember-cli model

ember -v
ember-cli: 2.4.3
node: 5.10.1
os: darwin x64

ember g model rental
相关标签:
2条回答
  • 2021-01-25 05:57

    There is nothing wrong with the generated code :)

    Ember Data has been made an addon, and part of that work was to tweak the public ES6 modules so everything doesn't hang off of the DS object. Now you can directly import the Model like in the first code sample you show.

    I have opened an issue on the Guides repository to fix the Tutorial section of the guides.

    0 讨论(0)
  • 2021-01-25 06:09

    The new generated code should look like the following,

    import Model from 'ember-data/model';
    import attr from 'ember-data/attr' ;
    
    
    export default Model.extend({
        title: attr('string'),
        owner: attr('string')
    });
    
    0 讨论(0)
提交回复
热议问题