|
|
|
@@ -1,14 +1,31 @@ |
|
|
|
import { Component } from '@angular/core'; |
|
|
|
// import { PostService } from './core/api/v1'; |
|
|
|
import {Component, OnInit} from '@angular/core'; |
|
|
|
import {ApiPostsGetCollection200Response, PostJsonld, PostService} from "./core/api/v1"; |
|
|
|
import {Observable, Subscription} from "rxjs"; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'app-root', |
|
|
|
templateUrl: './app.component.html', |
|
|
|
styleUrl: './app.component.scss' |
|
|
|
}) |
|
|
|
export class AppComponent { |
|
|
|
title = 'matsen-tool'; |
|
|
|
// posts$ = this.postService.postsGetCollection(); |
|
|
|
export class AppComponent implements OnInit{ |
|
|
|
title = 'matsen-tool'; |
|
|
|
protected postSub: Subscription; |
|
|
|
protected posts: Array<PostJsonld>; |
|
|
|
|
|
|
|
constructor(private postService: PostService) { |
|
|
|
this.postSub = new Subscription(); |
|
|
|
this.posts = []; |
|
|
|
} |
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
this.postSub = this.postService.postsGetCollection().subscribe( |
|
|
|
data => { |
|
|
|
|
|
|
|
this.posts = data.hydramember; |
|
|
|
console.log(data); |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// constructor(private postService: PostService) {} |
|
|
|
} |