Skip to content
Discussion options

You must be logged in to vote

Aha, Fixed the issue quite quickly by adding a ! at the end of return trigger.getAttribute('discord-invite-text')
Code:

ngAfterViewInit(): void {
    var inviteClipboard = new ClipboardJS('.copy-invite', {
      text: function (trigger) {
        return trigger.getAttribute('discord-invite-text')!;
      },
    });

    inviteClipboard.on('success', function (e) {
      const inviteTooltipText = document.getElementById(
        'tooltip-copy-link-dark'
      ) as HTMLDivElement;

      inviteTooltipText.innerHTML = 'Copied Discord Invite!';

      e.clearSelection();

      setTimeout(function () {
        inviteTooltipText.innerHTML = 'Copy Discord Invite'!;
      }, 2000);
    });
  }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by XdGoldenTigerOfficial
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant