Update about the showing the user images
This commit is contained in:
@@ -70,17 +70,16 @@ export class CreateUserComponent implements OnInit {
|
||||
createUser.lastName = this.formCtrls.lastname.value;
|
||||
createUser.email = this.formCtrls.email.value;
|
||||
|
||||
this.authenticationService
|
||||
.create(createUser)
|
||||
.pipe(first())
|
||||
.subscribe(
|
||||
data => {
|
||||
this.router.navigate([this.returnUrl]);
|
||||
},
|
||||
error => {
|
||||
this.error = error;
|
||||
this.invalidForm = false;
|
||||
}
|
||||
);
|
||||
this.authenticationService.create(createUser)
|
||||
.pipe(first())
|
||||
.subscribe(
|
||||
data => {
|
||||
this.router.navigate([this.returnUrl]);
|
||||
},
|
||||
error => {
|
||||
this.error = error;
|
||||
this.invalidForm = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { AuthenticationService } from "../../services/authentication.service";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
|
||||
@Component({
|
||||
@@ -7,9 +8,11 @@ import { ServiceComm } from "../../services/service-comm.service";
|
||||
styleUrls: ["./default.component.css"]
|
||||
})
|
||||
export class DefaultComponent implements OnInit {
|
||||
constructor(private serviceComm: ServiceComm) {}
|
||||
constructor(private serviceComm: ServiceComm,
|
||||
private authenticationService: AuthenticationService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.UpdatedComponentTitle("Home");
|
||||
this.authenticationService.alwaysLogin();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
<div *ngIf="resultsLength > 0">
|
||||
<table mat-table [dataSource]="dataSourceTable">
|
||||
<ng-container matColumnDef="comment">
|
||||
<th mat-header-cell *matHeaderCellDef>Name</th>
|
||||
<td mat-cell *matCellDef="let element">{{element.comment}}</td>
|
||||
<th mat-header-cell *matHeaderCellDef style="text-align: center;">Comments</th>
|
||||
<td mat-cell *matCellDef="let element" style="text-align: left;"><span style="white-space:nowrap;">{{element.comment}}</span></td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="data">
|
||||
<th mat-header-cell *matHeaderCellDef>Image</th>
|
||||
<td mat-cell *matCellDef="let element"><img src="{{element.data}}" alt="toto"></td>
|
||||
<th mat-header-cell *matHeaderCellDef style="text-align: center;">Image</th>
|
||||
<td mat-cell *matCellDef="let element" style="text-align: center;"><img src="{{element.data}}" alt="toto" style="width:50%;"></td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
|
||||
|
||||
@@ -42,13 +42,14 @@ export class ListOfImagesComponent implements OnInit {
|
||||
}
|
||||
|
||||
private getListOfImages() {
|
||||
this.serviceApi.getListOfImages().subscribe((data) => {
|
||||
setTimeout(() => {
|
||||
this.dataSourceTable = new MatTableDataSource<ImageResp>(data);
|
||||
this.dataSourceTable.paginator = this.paginator;
|
||||
this.resultsLength = data.length;
|
||||
}, 500);
|
||||
});
|
||||
this.serviceApi.getListOfImages()
|
||||
.subscribe((data) => {
|
||||
setTimeout(() => {
|
||||
this.dataSourceTable = new MatTableDataSource<ImageResp>(data);
|
||||
this.dataSourceTable.paginator = this.paginator;
|
||||
this.resultsLength = data.length;
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
public onFileChanged(fileInput: any) {
|
||||
|
||||
Reference in New Issue
Block a user