Skip to content

Secondary router-outlet not working with md-tabs #1445

Closed

Description

@tomwanzek

Bug, feature request, or proposal:

First of, thanks for all the hard work on Material 2!

I am using alpha 9-3 and as it appears, the issue I am encountering is related to this item: #524.

I intended to use a sidenav which contains a tab group. One of the tabs was conceived to serve as a context tab which is populated by a secondary, named router outlet `.

What is the expected behavior?

  • Option 1:
    The secondary router-outlet can contain a complete <md-tab>...</md-tab>, which can be switched to and from when changing the active tab in the group. (preferred)
  • Option 2:
    The secondary router-outlet provides the content for an already "hard-coded"
<template md-tab-content>
   <router-outlet name="context"></router-outlet>
</template md-tab-content>

This implies:
(a) a tertiary router-outlet is required to provide the <template md-tab-label> name
(b) the tab shell remains in the template, even for routes that do not required the context menu.

What is the current behavior?

Option 1: The secondary router outlet does not appear in the DOM. No rendering. No error messages.

Option 2: The secondary router outlet is initially rendered as expected into the tab content. However, when switching away from the tab and then back to it, the content is empty.

What are the steps to reproduce?

see description of steps above.

What is the use-case or motivation for changing an existing behavior?

The ability to use tabs based on router-state with primary and secondary outlets, e.g. as described above.

Which versions of Angular, Material, OS, browsers are affected?

angular material 9-3
angular-cli: 1.0.0-beta.16
node: 6.5.0
os: win32 x64

Browsers: Chrome, Firefox, Edge

Is there anything else we should know?

EDIT: Added issue reference to #524 which was accidentally omitted above.

Activity

  1. jelbourn commented on Oct 7, 2016

    @jelbourn
    Contributor

    Using tabs (or a tabs-like component) is captured by #524 and is planned work.

  2. tomwanzek commented on Nov 2, 2016

    @tomwanzek
    Author

    @jelbourn @andrewseguin I just had a quick look over the proposed solution to #524. While viable in a number of use cases, it does not seem to address the above use case.

    Any suggestions? The only other solution I can see is related to using a [hide] option as contemplated in #731.

    Thanks in advance for your insight.

  3. jelbourn commented on Nov 2, 2016

    @jelbourn
    Contributor

    @tomwanzek we will be adding a "hidden" option for tabs (per #731)

  4. tomwanzek commented on Nov 2, 2016

    @tomwanzek
    Author
  5. angular-automatic-lock-bot commented on Sep 5, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  6. locked and limited conversation to collaborators on Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions