Components: Table component sample code compiler error

Created on 30 Mar 2019  路  4Comments  路  Source: angular/components

What is the expected behavior?

none complier errors.

What is the current behavior?

official: https://material.angular.io/components/table/overview

line: 16

  @ViewChild(MatPaginator, {static: true}) paginator: MatPaginator;

errors:

Argument of type '{ static: boolean; }' is not assignable to parameter of type '{ read?: any; }'. Object literal may only specify known properties, and 'static' does not exist in type '{ read?: any; }'.

What are the steps to reproduce?

https://stackblitz.com/angular/egkyqnreoxr?file=app%2Ftable-pagination-example.ts

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

  • angular 7.2.11
  • material 7.3.6
  • MacOS 10.13.6
  • TypeScript 3.2.2
  • IDE IntelliJ Idea 2019.1

Is there anything else we should know?

none

All 4 comments

It only works like this:

@ViewChild(MatPaginator) paginator: MatPaginator;

PR 30948 should be the solution for your problem.

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

Related issues

julianobrasil picture julianobrasil  路  3Comments

savaryt picture savaryt  路  3Comments

LoganDupont picture LoganDupont  路  3Comments

Miiekeee picture Miiekeee  路  3Comments

3mp3ri0r picture 3mp3ri0r  路  3Comments