I am trying to stub API and thus I would like to return stubbed response from my Service.
My service method looks like:
public addItem(item): Observable<void> {
this.listOfItems.push(item);
return of();
}
And my component method looks like:
public submit(): void {
this.service.addItem(this.item)
.subscribe(() => console.log('working'));
}
Unfortunately this way subscribe is not entered and nothing is displayed in console.
How can I return empty Observable<void> that could be subscribed?