I\'m trying to add a \"clipboard\" directive using this example. The example is now outdated so I have had to update how it is getting the nativeElement.
I\'m gettin
You name ElementRef as eltRef but try to use this.el in ngAfterViewInit. You need to use the same name.
ElementRef
this.el
ngAfterViewInit
this will work:
constructor(private el:ElementRef) { } ngAfterViewInit() { this.clipboard = new Clipboard(this.el.nativeElement, { target: () => { return this.elt; } }