Получение ошибки TS2304: Не удается найти имя 'T' при использовании перетаскивания EventEmitter в Angular 7 - PullRequest
0 голосов
/ 23 декабря 2018

Я получаю сообщение об ошибке TS2304: не удается найти имя 'T', когда я пытаюсь использовать удаленный EventEmitter, доступный в angular / cdk / drag-drop.

Буду признателен за любую помощь.

Вот мой файл TS:

import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { DragDropModule, CdkDragDrop } from '@angular/cdk/drag-drop';

@Component({
  selector: 'app-scrum-values',
  templateUrl: './scrum-values.component.html',
  styleUrls: ['./scrum-values.component.css']
})
export class ScrumValuesComponent implements OnInit {

  @Output('cdkDropDropped') 
    dropped: EventEmitter<CdkDragDrop<T, any>> = 
      new EventEmitter<CdkDragDrop<T, any>>();

  constructor() { }

  ngOnInit() {
  }

}

Вот мой файл tsconfig:

{
  "compileOnSave": false,
  "compilerOptions": {
    "importHelpers": true,
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    // "skipLibCheck": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "types" : [
      "core-js"
    ],
    "lib": [
      "es2017",
      "dom"
    ],
    "module": "es2015",
    "baseUrl": "./"
  }
}
...