UNPKG

mean-guide-frontend

Version:

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1.

29 lines (28 loc) 973 B
<mat-spinner *ngIf="isLoading"></mat-spinner> <mat-accordion multi="true" *ngIf="posts.length > 0 && !isLoading"> <mat-expansion-panel *ngFor="let post of posts"> <mat-expansion-panel-header> {{ post.title }} </mat-expansion-panel-header> <div class="post-image"> <img [src]="post.imagePath" [alt]="post.title" /> </div> <p>{{ post.content }}</p> <mat-action-row *ngIf="userAuthenticated && userId === post.creator"> <a mat-button color="primary" [routerLink]="['/edit', post.id]">EDIT</a> <button mat-button color="warn" (click)="onDelete(post.id)"> DELETE </button> </mat-action-row> </mat-expansion-panel> </mat-accordion> <mat-paginator [length]="totalPosts" [pageSize]="postPerPage" [pageSizeOptions]="pageSizeOptions" (page)="onChangedPage($event)" *ngIf="posts.length" ></mat-paginator> <p class="mat-body-1 info-text" *ngIf="posts.length <= 0 && !isLoading"> No posts added yet </p>