mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
chore: remove deprecated Angular api (#9516)
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Directive, Input, HostListener, Component, ViewContainerRef, ComponentFactoryResolver, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import { Directive, Input, HostListener, Component, ViewContainerRef, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import { ClipboardService } from './clipboard.service';
|
||||
|
||||
@Directive({
|
||||
@@ -36,16 +36,12 @@ export class ClipboardDirective {
|
||||
// eslint-disable-next-line @angular-eslint/no-input-rename
|
||||
@Input('clipboard-notification') message: string;
|
||||
|
||||
constructor(private clipboardService: ClipboardService,
|
||||
public viewContainerRef: ViewContainerRef,
|
||||
private resolver: ComponentFactoryResolver) {}
|
||||
|
||||
constructor(private clipboardService: ClipboardService, public viewContainerRef: ViewContainerRef) {}
|
||||
|
||||
@HostListener('mouseenter')
|
||||
showTooltip() {
|
||||
if (this.placeholder) {
|
||||
const componentFactory = this.resolver.resolveComponentFactory(ClipboardComponent);
|
||||
const componentRef = this.viewContainerRef.createComponent(componentFactory).instance;
|
||||
const componentRef = this.viewContainerRef.createComponent(ClipboardComponent).instance;
|
||||
componentRef.placeholder = this.placeholder;
|
||||
}
|
||||
}
|
||||
@@ -70,14 +66,14 @@ export class ClipboardDirective {
|
||||
}
|
||||
}
|
||||
|
||||
private copyContentToClipboard(content) {
|
||||
private copyContentToClipboard(content: string) {
|
||||
this.clipboardService.copyContentToClipboard(content, this.message);
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'adf-copy-content-tooltip',
|
||||
template: `<span class='adf-copy-tooltip'>{{ placeholder | translate }} </span>`,
|
||||
template: `<span class="adf-copy-tooltip">{{ placeholder | translate }} </span>`,
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ClipboardComponent implements OnInit {
|
||||
|
Reference in New Issue
Block a user