File

src/app/services/data.service.ts

Index

Methods

Constructor

constructor(http: HttpClient)
Parameters :
Name Type Optional
http HttpClient no

Methods

loadData
loadData()
Returns : any
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { delay } from 'rxjs/operators';
@Injectable({
  providedIn: 'root'
})
export class DataService {

  constructor(private http:HttpClient) { }

  loadData(){
    return this.http.get('//pb-api.herokuapp.com/bars').pipe(delay(1000))
  }
}

results matching ""

    No results matching ""