From cc340c7392b991adb7f66626564807f53138bdd1 Mon Sep 17 00:00:00 2001 From: Marco Micalizzi Date: Fri, 5 Mar 2021 22:40:54 +0100 Subject: [PATCH 1/2] don't subscribe observable into ngOnInit method --- src/app/app.component.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 4e55a2c..ddaf040 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -15,9 +15,6 @@ export class AppComponent implements OnInit { } ngOnInit(): void { - this.onPushService.getData().subscribe(data => - console.info(`${JSON.stringify(data)}`) - ); } } From ba407b618c96c74c14390eea6c9fb5a7324b3910 Mon Sep 17 00:00:00 2001 From: Marco Micalizzi Date: Fri, 5 Mar 2021 22:42:07 +0100 Subject: [PATCH 2/2] pass data$ observable as input from service methods --- src/app/app.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index c1b2a6c..726213b 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,3 +1,3 @@

ON PUSH

- +