N.chauhan
N.chauhan

Reputation: 263

I have got issue when using Subject in rxjs

enter image description here

I am getting the issue when using Subject in rxjs. It give error when i give type string to Subject

Expected 0 type arguments, but got 1

Upvotes: 0

Views: 62

Answers (1)

Sajeetharan
Sajeetharan

Reputation: 222532

You should always initialize the subject inside the constructor,

Declare the variable as,

private _sourceSubject: Subject<string>;

and inside the constructor,

this._sourceSubject = new Subject<string>();

Upvotes: 1

Related Questions