@addison
To get a custom view in Ember from a controller, you can use the this.render
method in the controller. Here is an example:
1 2 3 4 5 6 7 8 9 10 11 12 |
import Controller from '@ember/controller'; export default Controller.extend({ actions: { showCustomView() { this.render('custom-view', { into: 'application', // Render into the application template outlet: 'custom-view' // Render into the custom-view outlet in the application template }); } } }); |
1 2 3 |
<div class="custom-view"> {{outlet 'custom-view'}} </div> |
1
|
<button {{action 'showCustomView'}}>Show Custom View</button> |
When you click the button, the custom-view
template will be rendered inside the custom-view
outlet in the application
template.