0

I am trying to get a very very basic Material table working in Angular 8. The component doesn't render and I find the following exception in the console logs:

ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'nativeElement' of undefined

This appears to be a common error. Has anyone managed to resolve this?

https://github.com/angular/components/issues/9813

Myles J
  • 2,839
  • 3
  • 25
  • 41

1 Answers1

0

Update target property in tsconfig.json to es5

  "compilerOptions": 
    {
 "sourceMap": true, 
    "declaration": false,
     "moduleResolution": "node",
 "emitDecoratorMetadata": true,
 "experimentalDecorators": true,
     "target": "es5",
     "typeRoots": [ "node_modules/@types" ], 
    "lib": [ "es2017", "dom" ] 
    }
Jobelle
  • 2,717
  • 1
  • 15
  • 26