Skip to content

ObjectUnsubscribedError when md-slider removed and re-added via *ngIf #6892

@TurplePurtle

Description

@TurplePurtle

Bug, feature request, or proposal:

Bug

What is the expected behavior?

The slider can be removed and added to the page by toggling the condition of an *ngIf directive on the slider itself or on a parent element/component.

What is the current behavior?

After removing the slider, and then adding it again by toggling the *ngIf off and on, an ObjectUnsubscribedError is raised.

What are the steps to reproduce?

https://embed.plnkr.co/oqhT6YMKMMKDopXfxgM7/

  1. Click "Hide slider"
  2. Click "Show slider"
  3. Error is raised, causing the slider to be rendered incorrectly.

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

The current behavior breaks the page if an md-slider is inside an *ngIf.

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

Tested in Angular 4.4.0-RC.0, Material 2.0.0-beta.10-6b5100b, Chrome 60, TypeScript 2.1.6

Is there anything else we should know?

Metadata

Metadata

Assignees

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