|
|
@@ -1,4 +1,7 @@
|
|
1
|
1
|
import { Component, OnInit } from '@angular/core';
|
|
|
2
|
+import { WpdataService} from '../services/wpdata.service';
|
|
|
3
|
+import { Observable } from 'rxjs';
|
|
|
4
|
+import { map } from 'rxjs/operators';
|
|
2
|
5
|
|
|
3
|
6
|
@Component({
|
|
4
|
7
|
selector: 'app-news',
|
|
|
@@ -7,9 +10,19 @@ import { Component, OnInit } from '@angular/core';
|
|
7
|
10
|
})
|
|
8
|
11
|
export class NewsPage implements OnInit {
|
|
9
|
12
|
|
|
10
|
|
- constructor() { }
|
|
|
13
|
+ newsdata: any;
|
|
|
14
|
+ // data: Observable;
|
|
|
15
|
+
|
|
|
16
|
+ constructor(private wpgetdataService: WpdataService) { }
|
|
11
|
17
|
|
|
12
|
18
|
ngOnInit() {
|
|
|
19
|
+ this.wpgetdataService.getAllNews().subscribe(data => {
|
|
|
20
|
+ // this.jsonService.getSummaryData().subscribe((data) => {
|
|
|
21
|
+ // this.newsdata = data;
|
|
|
22
|
+ // console.log('load Static Data');
|
|
|
23
|
+ console.log("get News:");
|
|
|
24
|
+ console.log(data);
|
|
|
25
|
+ });
|
|
13
|
26
|
}
|
|
14
|
27
|
|
|
15
|
28
|
}
|