Currently, I am attempting to stub an API and would like to retrieve a stubbed response from my Service.
The method in my service appears as follows:
public addItem(item): Observable<void> {
this.listOfItems.push(item);
return of();
}
As for my component method, it looks something like this:
public submit(): void {
this.service.addItem(this.item)
.subscribe(() => console.log('working'));
}
Regrettably, the current setup does not trigger the subscribe function and nothing is displayed in the console log.
What can I do to return an empty Observable<void>
that can be subscribed to?