Skip to content

<md-slide-toggle> change handler not firing properly. #7168

Closed
@jt-helsinki

Description

@jt-helsinki

Bug, feature request, or proposal:

Bug

What is the expected behavior?

The <md-slide-toggle> change event fires as component values changes

What is the current behavior?

component value is not passed to change handler when toggle value changes.

What are the steps to reproduce?

Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: https://goo.gl/DlHd6U

For example:

<md-slide-toggle #showArchivedInput="ngModel"
                    [(ngModel)]="showArchived"
                    name="showArchived"
                    color="primary"
                    (change)="showArchived(showArchivedInput.value)">
                    Show Archived
                </md-slide-toggle>

...


showArchived(archived: boolean): void {
    console.log(archived); // incorrectly shows the inverse of the toggle state
}

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

This was working as intended.

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

material 2.0.0-beta.10
Angular 4.3.6

Is there anything else we should know?

this was working as intended. This was broken in the current release.

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