didInsertElement not working


#1

I’ve the follow route:

this.route('cards', function() {
  this.route('all');
  this.route('card', {path: '/:card_id'}, function() {
    this.route('edit');
  });
  this.route('new');
});

Inside my /routes/card.js, if I add the following code:

didInsertElement() {
  console.log('hello world');
}

I can’t see hello world in the console.

Repo link: https://github.com/ghoshnirmalya/hub-client.

I’m using the following:

Ember: 2.6.1 and Ember Data: 2.6.1


#2

You’re supposed to add that didInsertElement() inside components, not routes.