Ember-cli Pods&加载模板 [英] Ember-cli Pods & Loading Templates
本文介绍了Ember-cli Pods&加载模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经为我的应用程序创建了一个正在工作的加载模板,我现在正在尝试为我的路由创建自定义加载模板,我不能工作。
I have created a loading template for my application that is working and I'm now trying to create custom loading templates for my routes and I can't it to work.
这是我的文件结构(使用pod)。
Here is my file structure (using pods).
- app
- | pods
- - | application
- - - - adapter.js
- - - - template.hbs
- - | loading
- - - - template.hbs
- - | author
- - - - model.js
- - - | show
- - - - controller.js
- - - - route.js
- - - - template.hbs
- - - - | loading
- - - - - - template.hbs
这是我的router.js
Here is my router.js
Router.map(function()
{
this.route('author.show', { path: '/author/:author_id' });
});
我正在使用
- ember 1.13.7
- ember-cli 1.13.8
- ember-data 1.13.8
如何获取我的'author.show'路由的自定义加载模板?
How do I get a custom loading template for my 'author.show' route?
推荐答案
SOLVED!
我需要重新组织我的router.js以使用父/子路由格式:
I needed to re-organise my router.js to use the parent/child route format:
export default Router.map(function() {
this.route('author', { path: "authors" }, function() {
this.route('list', { path: "list" });
this.route('show', { path: ":id" });
});
});
- 路线:作者使用荚/载入
- 路线: author.list 使用 pods / author / loading
- 路线: author.show 使用 pods / author / loading
- Route: author uses pods/loading
- Route: author.list uses pods/author/loading
- Route: author.show uses pods/author/loading
这篇关于Ember-cli Pods&加载模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文