Skip to content

Mat-sort not working inside an ngif #15966

@Swoox

Description

@Swoox

Bug:

On the Mat-table the sort isn't working if it's inside an *ngIf.

What is the expected behavior?

The sort should work no matter if it's an ngIf or not.

What is the current behavior?

See bug.

What are the steps to reproduce?

https://stackblitz.com/edit/angular-27gm6u

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

I want to use another table style if I'm on my phone.

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

Tested it in chrome.
CDK/materials: 7.3.7
Angular: 7.2.5
Typescript: 3.1.1

Is there anything else we should know?

Probably it's also related to the filter and paginator not working.

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