In the realm of Angular 4, I have crafted a service that currently relies on an HTTP request to produce an Observable of type Comment.
return this.http.post(targetUrl, JSON.stringify({ 'Text': comment.Text, 'ThreadId': threadId }), options)
.map(this.extractData)
.catch(this.handleError);
Here's the dilemma: when operating on a local host, I aspire for this service to provide data from a locally constructed variable. However, simply returning said local variable of comment type won't suffice, as it lacks observability. How might I transform this local creation into an observable entity?