内容简介:我有多个表示用户数据的模型(配置文件,设置等).目前这些都存储在models文件夹中,如此;我想要的是这样的文件夹结构;
我有多个表示用户数据的模型(配置文件,设置等).
目前这些都存储在models文件夹中,如此;
models -> user.js -> profile.js -> settings.js
我想要的是这样的文件夹结构;
models
-> user.js
-> user (folder)
-> profile.js
-> settings.js
用户模型(user.js)像这样引用配置文件模型(profile.js);
import DS from "ember-data";
export default DS.Model.extend({
NSP: DS.attr('string'),
Status: DS.attr('string'),
Profile: DS.belongsTo('profile', {embedded: 'always'})
});
我试图用以下内容替换DS.belongsTo(‘profile’,{embedded:’always’}):
> DS.belongsTo(‘user.profile’,{embedded:’always’})
> DS.belongsTo(‘user / profile’,{embedded:’always’})
> DS.belongsTo(‘user-profile’,{embedded:’always’})
但这不起作用.
我在这里错过了什么吗?
以上所述就是小编给大家介绍的《在子文件夹中组织Ember.js模型?》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:- Node.js折腾记一:读指定文件夹,输出该文件夹的文件树
- tar打包如何不打包某一个文件夹(排除某些文件夹)
- Scala在资源文件夹中获取文件的文件路径
- C/C++遍历文件夹和文件
- QT选择目录等常用文件/文件夹操作
- 如何使用Python删除一个文件或文件夹
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Dreamweaver CS3 Bible
Joseph W. Lowery / Wiley / May 21, 2007 / $49.99
Book Description Learn to create dynamic, data-driven Web sites using the exciting enhancements in the Dreamweaver CS3 version. You get a thorough understanding of the basics and then progress to l......一起来看看 《Dreamweaver CS3 Bible》 这本书的介绍吧!