M.Maria
M.Maria

Reputation: 111

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() { }
}

Upvotes: 0

Views: 1932

Answers (2)

amlan_sengupta
amlan_sengupta

Reputation: 1

If you are using VS code, it would import eventEmitter from the protractor. //import {EventEmitter} from'protractor' instead, you would want to import this from 'angular/core'.

Upvotes: 0

Evaldas Buinauskas
Evaldas Buinauskas

Reputation: 14077

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.

Upvotes: 2

Related Questions