question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Undefined MatSort Directive From MatTable Inside a MatStepper

See original GitHub issue

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Using @ViewChild(MatSort) get the Directive from inside a Stepper

What is the current behavior?

Returns Undefined

What are the steps to reproduce?

http://plnkr.co/edit/mLbnnpLG5bDumD2jBYZt?p=info

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

Select from list to advance to next step

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
kalitinecommented, Aug 31, 2018

I have the same issue. Tried to import all modules, but still doesn’t work. Could it be related to something else?

UPDATE: I found the problem. It is undefined because of *ngIf directive on the tag above mat-table (even if it evaluates to true).

2reactions
thre3eyecommented, Sep 25, 2018

I have the same issue. Tried to import all modules, but still doesn’t work. Could it be related to something else?

UPDATE: I found the problem. It is undefined because of *ngIf directive on the tag above mat-table (even if it evaluates to true).

Good find! Removing *ngIf fixed the issue. This is a bug and should be re-opened.

UPDATE: ng-if instead of *ngIf works

Read more comments on GitHub >

github_iconTop Results From Across the Web

mat-sort not working on mat-table - Stack Overflow
Any help is greatly appreciated! MatSortModule is already imported in app.module.ts, mat-sort-header directives are applied to the columns and ...
Read more >
Matsort Is Undefined - Angular 5 - ADocLib
Menu Undefined MatSort Directive From MatTable Inside a MatStepper. Fantashit January 4 Using @ViewChild(MatSort) get the Directive from inside a Stepper.
Read more >
Sort header - Angular Material
These headers should be contained within a parent element with the matSort directive, which will emit a matSortChange event when the user triggers...
Read more >
Stepper | Angular Material
UI component infrastructure and Material Design components for mobile and desktop Angular web applications.
Read more >
UNPKG - @angular/material
_filter.next(filter); }\n\n /**\n * Instance of the MatSort directive used ... CdkStepperPrevious} from '@angular/cdk/stepper';\nimport {MatStepper} from '.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found