Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8722081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:19:48+00:00 2026-06-13T07:19:48+00:00

I have an application with an application template that has two outlets. When I

  • 0

I have an application with an application template that has two outlets. When I enter the root.index state, I only want one outlet to be connected, and when I enter the root.chats state, I want both outlets to be connected. This works fine when I navigate from root.index to root.chats, but when I navigate back the navpane outlet is still present (as it should be). How do I go about disconnecting this outlet or removing the view that was hooked up in the first place? Is the disconnectOutlet method for the controller mixin deprecated? Should I be structuring this completely differently? I’ve included my code below. Thanks.

// State flag helper function. See https://github.com/ghempton/ember-router-example/blob/master/js/app.js

function stateFlag(name) {
  return Ember.computed(function() {
    var state = App.router.currentState;
    while(state) {
      if(state.name === name) return true;
      state = state.get('parentState');
    }
    return false;
  }).property('App.router.currentState');
}

// Application

App = Em.Application.create({

    ApplicationController: Ember.Controller.extend({
        isChats: stateFlag('chats')
    }),
    ApplicationView: Ember.View.extend({
        templateName: 'application'
    }),
    ChatlistController:  Em.Controller.extend({
        hideView: false
    }),
    ChatlistView:  Em.View.extend({
        templateName:  'chatlist',
        didInsertElement: function(){
            this.$("#nav_pane").css({'left':'-=275', 'z-index':'-5'}).animate({
                left: ["+=275", 'swing'],
            },500,function() {
                $(this).css('z-index','5')
            });
        },
        _hideViewChanged: function() {
            if (this.get('hideView')) {
                this.hide();
            }
        }.observes('hideView'),
        hide: function() {
            var that = this;
            this.$("#nav_pane").hide("slow", function() {
                that.remove();
            });
        }
    }),
    ChatroomController:  Em.Controller.extend({

    }),
    ChatroomView:  Em.View.extend({
        templateName:  'chatroom'
    }),
    DashboardController:  Em.Controller.extend({

    }),
    DashboardView:  Em.View.extend({
        templateName:  'dashboard'
    }),
    Router: Ember.Router.extend({
        //location: 'history',
        enableLogging: true,
        goToDashboard:  Ember.Route.transitionTo('root.index'),
        goToChats:  Ember.Route.transitionTo('root.chats'),
        root:  Ember.Route.extend({
            index:  Ember.Route.extend({
                route:  '/',
                connectOutlets: function(router, context) {
                    router.get('applicationController').connectOutlet('content', 'dashboard');
                }
            }),
            chats:  Ember.Route.extend({
                route:  '/chats',
                connectOutlets: function(router, context) {
                    router.get('applicationController').connectOutlet('navpane', 'chatlist');
                    router.get('applicationController').connectOutlet('content', 'chatroom');
                }
            }),
            files:  Ember.Route.extend({
                route:  '/files'
            })
        })
    })
});

App.initialize();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:19:49+00:00Added an answer on June 13, 2026 at 7:19 am

    I believe you’re looking for disconnectOutlet, which is not at all deprecated: http://emberjs.com/api/classes/Ember.Controller.html#method_disconnectOutlet

    A good place for it to live is on the route’s exit event: http://emberjs.com/api/classes/Ember.State.html#event_exit

    chats:  Ember.Route.extend({
        route:  '/chats',
        connectOutlets: function(router, context) {
            router.get('applicationController').connectOutlet('navpane', 'chatlist');
            router.get('applicationController').connectOutlet('content', 'chatroom');
        },
        exit: function(router){
          router.get('applicationController').disconnectOutlet('chatroom');
        }
    }),
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Tools: SQL2000/5/8, .NET 3.5, C# I have come across an application that has two
I have a web application written in Django that has one specific page I'd
I made a tab bar application that has only one xib file. If you
I have in my application a data template that has a few buttons. I
I have an application that I started with the Utility Application template. I'm using
I have Microsoft Word template that I automated filling it's fields from my application,
I have a web application where the masterPage/template contains some static HTML that never
I have a Visual Studio 2008 C++ application that does something like this: template<
I have a 3-columns template in my web application. Imagine that the right-side div
I have a Silverlight RIA application that uses Forms authentication. We want to pass

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.