Commit 4b5b83c9 authored by mdsecurity's avatar mdsecurity
Browse files

scrapping current api call method

redoing the current api call method so it correctly goes through the chain of first
serving whatever is in local storage
checking if the api changed
updating local storage if need be
updating the js object
parent 207ecc42
......@@ -26,6 +26,7 @@ export class DataProviderService {
constructor(private http: Http) { }
getFacilities(): Observable<Place[]> {
console.log("I was called");
if (this.places) {
return Observable.of(this.places);
} else if (this.placesObs) {
......@@ -37,7 +38,6 @@ export class DataProviderService {
this.placesObs = Observable.of(this.places);
return this.placesObs;
} else {
this.placesObs = this.http.get(this.Url)
.map((data) => {
this.placesObs = null;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment