TypeError:对象不支持属性或方法“ renderRows”

时间:2018-07-23 01:58:02

标签: angular angular-material angular-material2

我有以下package.json设置。我做事的时候一切都很好。但是,当我运行我的应用程序时,我的垫表将无法加载,并且在控制台中显示“ TypeError:对象不支持属性或方法'renderRows'”。我在一篇文章中看到这是由于cdk版本引起的。但是已经是5.2.5。请告知。

  "dependencies": {
    "@angular/animations": "^5.2.5",
    "@angular/cdk": "^5.2.5",
    "@angular/common": "^5.2.5",
    "@angular/compiler": "^5.2.5",
    "@angular/core": "^5.2.5",
    "@angular/flex-layout": "^5.0.0-beta.14",
    "@angular/forms": "^5.2.5",
    "@angular/http": "^5.2.5",
    "@angular/material": "^5.2.5",
    "@angular/platform-browser": "^5.2.5",
    "@angular/platform-browser-dynamic": "^5.2.5",
    "@angular/router": "^5.2.5",
    "core-js": "^2.4.1",
    "d3": "^4.13.0",
    "node-sass": "^4.8.1",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "~1.7.4",
    "@angular/compiler-cli": "^5.2.5",
    "@angular/language-service": "^5.2.5",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  }

1 个答案:

答案 0 :(得分:0)

现在还可以,我错误地从中添加了'dataTable'

@ViewChild('dataTable') dataTable: MatTable<Test>;

错误的div。我将其移至<mat-table>