Ajout d'une pop-in pour l'ajout
This commit is contained in:
@@ -1,36 +1,38 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
import { Component, OnInit, ViewChild } from "@angular/core";
|
||||
import { MatPaginator } from "@angular/material/paginator";
|
||||
import { MatTableDataSource } from "@angular/material/table";
|
||||
import { MatDialog } from "@angular/material/dialog";
|
||||
|
||||
import { GearService } from '../../services/gear.service';
|
||||
import { ServiceComm } from '../../services/service-comm.service';
|
||||
import { GearResp } from '../../models/gear';
|
||||
import { AddAction } from '../../models/add-action.enum';
|
||||
import { GearService } from "../../services/gear.service";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
import { GearResp } from "../../models/gear";
|
||||
import { AddAction } from "../../models/add-action.enum";
|
||||
import { NewGearComponent } from "../new-gear/new-gear.component";
|
||||
|
||||
@Component({
|
||||
selector: 'app-list-of-gears',
|
||||
templateUrl: './list-of-gears.component.html',
|
||||
styleUrls: ['./list-of-gears.component.css']
|
||||
selector: "app-list-of-gears",
|
||||
templateUrl: "./list-of-gears.component.html",
|
||||
styleUrls: ["./list-of-gears.component.css"]
|
||||
})
|
||||
export class ListOfGearsComponent implements OnInit {
|
||||
public displayedColumns: Array<string> = [
|
||||
'id',
|
||||
'name',
|
||||
'manufacturer',
|
||||
'maxSize',
|
||||
'aad',
|
||||
'mainCanopy',
|
||||
'reserveCanopy'
|
||||
"id",
|
||||
"name",
|
||||
"manufacturer",
|
||||
"maxSize",
|
||||
"aad",
|
||||
"mainCanopy",
|
||||
"reserveCanopy"
|
||||
];
|
||||
public dataSourceTable: MatTableDataSource<GearResp>;
|
||||
public resultsLength = 0;
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
public showAddForm: boolean;
|
||||
|
||||
constructor(
|
||||
private serviceApi: GearService,
|
||||
private serviceComm: ServiceComm
|
||||
) { }
|
||||
private serviceComm: ServiceComm,
|
||||
public dialog: MatDialog
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.refreshRequest.subscribe(action => {
|
||||
@@ -38,7 +40,7 @@ export class ListOfGearsComponent implements OnInit {
|
||||
this.getListOfGears();
|
||||
}
|
||||
});
|
||||
this.serviceComm.UpdatedComponentTitle('List of gears');
|
||||
this.serviceComm.UpdatedComponentTitle("List of gears");
|
||||
|
||||
this.getListOfGears();
|
||||
}
|
||||
@@ -53,7 +55,7 @@ export class ListOfGearsComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
public add() {
|
||||
this.showAddForm = true;
|
||||
openDialogToAdd() {
|
||||
this.dialog.open(NewGearComponent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user