main #6
2 changed files with 8 additions and 2 deletions
|
@ -14,7 +14,9 @@
|
||||||
<ng-container matColumnDef="id">
|
<ng-container matColumnDef="id">
|
||||||
<th mat-header-cell *matHeaderCellDef> ID </th>
|
<th mat-header-cell *matHeaderCellDef> ID </th>
|
||||||
<td mat-cell *matCellDef="let element">
|
<td mat-cell *matCellDef="let element">
|
||||||
|
<a href="{{element.id}}">
|
||||||
{{element.id}}
|
{{element.id}}
|
||||||
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,11 @@ export class DashboardComponent {
|
||||||
constructor(private linkService: LinkService, private router: Router) { };
|
constructor(private linkService: LinkService, private router: Router) { };
|
||||||
|
|
||||||
copyLink(id: string) {
|
copyLink(id: string) {
|
||||||
navigator.clipboard.writeText(window.location.hostname + '/' + id);
|
navigator.clipboard.writeText(this.getShortLink(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
getShortLink(id: string): string {
|
||||||
|
return window.location.hostname + '/' + id;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
|
Loading…
Add table
Reference in a new issue