Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4835

Modals as components not controllers

$
0
0

@johnunclesam wrote:

I searched but nothing made me happy.

I found this: http://ember.guru/2014/master-your-modals-in-ember-js

But he’s using controller. I need to use components.

How can I use this code for component?

app/routes/application.js

showModal(name, model) {
  console.log('showModal() in application.js called!');
  this.render('components/' + name, {
    into: 'application',
    outlet: 'modal',
    model: model
  });
},

removeModal() {
  console.log('removeModal() in application.js called!');
  this.disconnectOutlet({
    outlet: 'modal',
    parentView: 'application'
  });
}

this.render just render, of course, the .hbs of my component. The code (like didInsertElement) of that component is not executed.

Maybe with a fake template in templates folder? But how?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4835

Trending Articles