typescript - Expected 0 type arguments, but got 1.ts(2558)
问题描述
I'm creating a new angular service for components communication. but once I create my new Subject , I get this error : Expected 0 type arguments, but got 1.ts(2558). I'm working with Angular 7. this is My service :
import { Injectable } from '@angular/core';
import { Subject } from '../../../types/rxjs';
@Injectable({
providedIn: 'root'
})
export class InteractionService {
private sprintData = new Subject<any[]>();
constructor() { }
}
解决方案
Only thing I can think of is your import statement. I'd change that to:
import { Subject } from 'rxjs';
I suspect that your current import is from internals.
推荐阅读
- ms-word - 如何更改插入到默认 office 选项卡中的加载项的组位置?
- python - Python 3.7 - Windows 10 上的 PIP 升级错误
- python - 在 YOLO 中指定对象
- angular - Angular Material 7:整行的链接
- javascript - 将 2 位小数添加到变量类型编号
- grails - Grails GORM 行为异常
- webpack - 在 React 中设置 Sass 和 CSS 模块时的 Webpack 问题
- database - PostgreSQL:如何使用自定义 emunsortorder 值定义 ENUM 类型
- spotfire - 折线图,缺失 x 轴数据的常数值
- azure-data-factory - 在复制数据活动中检索 blob 文件名