Explorar el Código

error getting post entries

master
Daniel hace 2 años
padre
commit
4de1f03e5d
Se han modificado 3 ficheros con 30 adiciones y 12 borrados
  1. +5
    -5
      matsen-tool/src/app/app.component.html
  2. +23
    -6
      matsen-tool/src/app/app.component.ts
  3. +2
    -1
      matsen-tool/src/environment.ts

+ 5
- 5
matsen-tool/src/app/app.component.html Ver fichero

@@ -1,11 +1,11 @@

<app-login></app-login>
<!--<ul>-->
<!-- <li>Posts</li>-->
<!-- <li *ngFor="let post of posts$ | async">-->
<!-- <h2>{{post.}} - {{post.owner}}</h2>-->
<ul>
<li>Posts</li>
<!-- <li *ngFor="let post of posts">-->
<!-- <h2>{{post.id}} - {{post.owner}}</h2>-->
<!-- <p>{{post.message}}</p>-->
<!-- </li>-->
<!--</ul>-->
</ul>

<router-outlet></router-outlet>

+ 23
- 6
matsen-tool/src/app/app.component.ts Ver fichero

@@ -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) {}
}

+ 2
- 1
matsen-tool/src/environment.ts Ver fichero

@@ -1,4 +1,5 @@
export const environment = {
production: false,
basePath: 'https://matsen-tool-be.ddev.site:8443',
// basePath: 'https://matsen-tool-be.ddev.site:8443',
basePath: 'https://127.0.0.1:49858',
};

Cargando…
Cancelar
Guardar