When I call this function the console.log() works, but the http.delete method never runs, I assume because I haven't subscribed to the observable.
Because I'm calling this from a button on a form, I don't care about returning anything so is there a way to just make the call?
deleteCompany(id) {
console.log('from data service: ', id);
this.http.delete(this.url + 'Companies/' + id + '?' + this.token).map(res => res.json());
}
Edit: I went with this instead. Is this the correct way to handle this?
import 'rxjs/add/operator/toPromise';
...
return this.http.delete(this.url + 'Companies/' + id + '?' + this.token).toPromise();
subscribe()
without passing a callback. I think this makes it more obvious what the intent is.