angular 15 升级到 angular 17 之后,下面的代码报错
private _sub = new Subject();
this._sub.next();
报错信息如下
error TS2554: Expected 1 arguments, but got 0.
498 this._sub.next();
~~~~
node_modules/rxjs/dist/types/internal/Subject.d.ts:32:10
32 next(value: T): void;
~~~~~~~~
An argument for 'value' was not provided.
请问如何解决?
给 Subject
指定 void
类型解决了
private _sub = new Subject<void>();