Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember-cli Pods & Loading Templates

Tags:

ember.js

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.

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

Here is my router.js

Router.map(function()
{
  this.route('author.show', { path: '/author/:author_id' });
});

I am using

  • ember 1.13.7
  • ember-cli 1.13.8
  • ember-data 1.13.8

How do I get a custom loading template for my 'author.show' route?

like image 541
Matheos Avatar asked Aug 15 '26 13:08

Matheos


1 Answers

SOLVED!

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" });
    });
});
  • Route: author uses pods/loading
  • Route: author.list uses pods/author/loading
  • Route: author.show uses pods/author/loading
like image 71
Matheos Avatar answered Aug 18 '26 02:08

Matheos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!