Angular issue #823
Answered
by
christopher-nzcs
christopher-nzcs
asked this question in
Q&A
-
|
Hey everyone! I am creating a project in Angular (Typescript), and I have a slight issue, Everything works, But there is only one error. Here is my code, If anyone knows what I need to do, Please let me know! |
Beta Was this translation helpful? Give feedback.
Answered by
christopher-nzcs
Oct 16, 2022
Replies: 1 comment
-
|
Aha, Fixed the issue quite quickly by adding a 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);
});
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
christopher-nzcs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

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