From 48750470bdbffe6a213a03f56e1fbffad4be02ee Mon Sep 17 00:00:00 2001 From: Simon Hanna Date: Mon, 20 Aug 2018 14:12:30 +0200 Subject: [PATCH] Service items are displayed --- src/app/openlp.service.ts | 15 --------------- src/app/service.component.ts | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/app/openlp.service.ts b/src/app/openlp.service.ts index 065cc86..d45b5fe 100644 --- a/src/app/openlp.service.ts +++ b/src/app/openlp.service.ts @@ -192,12 +192,6 @@ export class OpenLPService { } /* - search(plugin, text) { - return this.http.get('http://localhost:4316/' + plugin + '/search', buildTextParams(text)) - .toPromise() - .then(response => response.json().results.items) - .catch(this.handleError); - } sendItemLive(plugin, id) { this.http.get('http://localhost:4316/' + plugin + '/live', buildNumberParams(id)) @@ -212,14 +206,5 @@ export class OpenLPService { .then(response => console.log(response)) .catch(this.dropError); } - - private dropError(error: any) { - console.error('An error occurred', error); - } - - private handleError(error: any) { - console.error('An error occurred', error); - return Promise.reject(error.message || error); - } */ } diff --git a/src/app/service.component.ts b/src/app/service.component.ts index dce2f68..d57d9d5 100644 --- a/src/app/service.component.ts +++ b/src/app/service.component.ts @@ -30,7 +30,7 @@ export class OpenLPServiceComponent implements OnInit { } getServiceItems() { - // this.openlpService.getServiceItems().then(items => this.items = items); + this.openlpService.getServiceItems().subscribe(items => this.items = items); } constructor(private openlpService: OpenLPService, private router: Router) {