D
D
Dima Pautov2016-11-24 22:39:16
Ember.js
Dima Pautov, 2016-11-24 22:39:16

How to get rid of showing parent template in ember js?

Good evening! By setting up the root, for example this:

this.route('news', function() {
    this.route('add');
    this.route('news-item', {
        path: '/:news-item_id'
    }, function() {
      this.route('edit');
    });
  });

I noticed such a thing that when I go to the page for adding news, I also display the parent template "News". How can it be removed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Станислав Романов, 2016-11-25
@bootd

Привет.
Выводи список новостей не в news, а в news.index
Выглядеть будет примерно так:

// templates/news.hbs
{{outlet}}

// templates/news/index.hbs
// Вывод списка news

// templates/news/news-item.hbs
// Вывод одной новости

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question