Quellcode durchsuchen

error getting post entries

master
Daniel vor 2 Jahren
Ursprung
Commit
4de1f03e5d
3 geänderte Dateien mit 30 neuen und 12 gelöschten Zeilen
  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 Datei anzeigen

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


<app-login></app-login> <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>--> <!-- <p>{{post.message}}</p>-->
<!-- </li>--> <!-- </li>-->
<!--</ul>-->
</ul>


<router-outlet></router-outlet> <router-outlet></router-outlet>

+ 23
- 6
matsen-tool/src/app/app.component.ts Datei anzeigen

@@ -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({ @Component({
selector: 'app-root', selector: 'app-root',
templateUrl: './app.component.html', templateUrl: './app.component.html',
styleUrl: './app.component.scss' 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 Datei anzeigen

@@ -1,4 +1,5 @@
export const environment = { export const environment = {
production: false, 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',
}; };

Laden…
Abbrechen
Speichern