Route#disconnectOutlet()

disconnectOutlet (options) public

Defined in packages/ember-routing/lib/system/route.js:1957

Disconnects a view that has been rendered into an outlet.

You may pass any or all of the following options to disconnectOutlet:

  • outlet: the name of the outlet to clear (default: 'main')
  • parentView: the name of the view containing the outlet to clear (default: the view rendered by the parent route)

Example:

App.ApplicationRoute = App.Route.extend({
  actions: {
    showModal: function(evt) {
      this.render(evt.modalName, {
        outlet: 'modal',
        into: 'application'
      });
    },
    hideModal: function(evt) {
      this.disconnectOutlet({
        outlet: 'modal',
        parentView: 'application'
      });
    }
  }
});

Alternatively, you can pass the outlet name directly as a string.

Example:

hideModal: function(evt) {
  this.disconnectOutlet('modal');
}

Parameters:

options Object|String
the options hash or outlet name
doc_EmberJs
2016-11-30 16:53:07
Comments
Leave a Comment

Please login to continue.