[英]How do you get a Loading template in ember-cli PODS?
我看過這個網址的Ember-cli Pods和加載模板,但是添加了/app/bugs/loading.hbs或/app/bugs/detail/loading.hbs甚至/app/bugs/detail/loading/template.hbs都沒有不行
我想念一些容易的事-有什么想法嗎?
由於文檔未特別提及Pod,並且我已經看到一些人使用看起來像是較舊的文件夾結構在網上提出了這個問題,因此我將在此處回答。
對於我的/ bug路由,我在以下位置
./app/bugs/index/route.js
import Ember from 'ember'; export default Ember.Route.extend({ model() { return this.store.findAll('bug'); }, actions: { loading(transition, originRoute) { console.log('loading transition'); console.log(originRoute); //let controller = this.controllerFor('bugs'); //controller.set('currentlyLoading', true); transition.promise.finally(function () { console.log('done loading'); //controller.set('currentlyLoading', false); }); } } });
查找的加載模板位於
./app/bugs/index-loading/template.hbs
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.