feat(dashboard): add copy link button to dashboard table
This commit is contained in:
parent
79fc66ef6b
commit
50cb62e56d
3 changed files with 10 additions and 1 deletions
|
@ -13,7 +13,10 @@
|
|||
<!-- Position Column -->
|
||||
<ng-container matColumnDef="id">
|
||||
<th mat-header-cell *matHeaderCellDef> ID </th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.id}} </td>
|
||||
<td mat-cell *matCellDef="let element">
|
||||
{{element.id}}
|
||||
<button mat-flat-button class="my-3" (click)="copyLink(element.id)">Copy short url</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<!-- Name Column -->
|
||||
|
|
|
@ -20,6 +20,10 @@ export class DashboardComponent {
|
|||
|
||||
constructor(private linkService: LinkService, private router: Router) { };
|
||||
|
||||
copyLink(id: string) {
|
||||
navigator.clipboard.writeText(window.location.hostname + '/' + id);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.linkService.getLinks().then(links => {
|
||||
this.links = links;
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
<p>Your are being redirected.</p>
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5944102294748899"
|
||||
crossorigin="anonymous"></script>
|
||||
|
|
Loading…
Add table
Reference in a new issue