@@ -25,6 +25,7 @@ import { MyBookmarksStore } from '../../core/user/my-bookmarks.store';
2525import { NavigationEnd , Router } from '@angular/router' ;
2626import { LoginDialogHelperService } from '../../core/login-dialog-helper.service' ;
2727import { AddToHistoryService } from '../../core/user/add-to-history.service' ;
28+ import { Clipboard } from '@angular/cdk/clipboard' ;
2829
2930@Component ( {
3031 selector : 'app-bookmark-list-element' ,
@@ -64,6 +65,8 @@ export class BookmarkListElementComponent extends TagFollowingBaseComponent impl
6465
6566 private navigationSubscription : Subscription ;
6667
68+ copyLinkButtonText = '' ;
69+
6770 constructor ( private router : Router ,
6871 private playYoutubeDialog : MatDialog ,
6972 public loginDialog : MatDialog ,
@@ -81,7 +84,8 @@ export class BookmarkListElementComponent extends TagFollowingBaseComponent impl
8184 private feedStore : FeedStore ,
8285 private loginDialogHelperService : LoginDialogHelperService ,
8386 private myBookmarksStore : MyBookmarksStore ,
84- public addToHistoryService : AddToHistoryService ) {
87+ public addToHistoryService : AddToHistoryService ,
88+ private clipboard : Clipboard ) {
8589 super ( loginDialog , userDataWatchedTagsStore ) ;
8690
8791 // START force reload on same root - solution taken from https://github.com/angular/angular/issues/13831
@@ -280,4 +284,11 @@ export class BookmarkListElementComponent extends TagFollowingBaseComponent impl
280284 }
281285 }
282286
287+ copyToClipboard ( location : string ) {
288+ const copied = this . clipboard . copy ( location ) ;
289+ if ( copied ) {
290+ this . copyLinkButtonText = ' Copied' ;
291+ setTimeout ( ( ) => this . copyLinkButtonText = '' , 1300 ) ;
292+ }
293+ }
283294}
0 commit comments