Components: Undefined MatSort Directive From MatTable Inside a MatStepper

Created on 26 Oct 2017  路  6Comments  路  Source: angular/components

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

P4

Most helpful comment

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).

All 6 comments

You must import MatSortModule.

@DevVersion could you add it and MatPaginatorModule to the default template's PlunkerMaterialModule?

@DevVersion can you take a look if this is just updating the plunker setup?

@willshowell @jelbourn Updated the Plunker template. And yeah this issue seems to be fixed by adding the necessary modules.

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).

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

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._

Was this page helpful?
0 / 5 - 0 ratings