[ADF-4405] [ADF-4423] Fix clipboard directive on json cell (#4623)

* [ADF-4405] [ADF-4423] Fix clipboard directive on json cell

* Update clipboard.directive.ts

* fix spell
This commit is contained in:
davidcanonieto 2019-04-23 12:24:39 +02:00 committed by Eugenio Romano
parent 834c32f23f
commit 630b1043a9
3 changed files with 7 additions and 7 deletions

View File

@ -31,7 +31,7 @@
readonly="readonly"> readonly="readonly">
<mat-icon class="adf-input-action" matSuffix <mat-icon class="adf-input-action" matSuffix
[clipboard-notification]="'SHARE.CLIPBOARD-MESSAGE' | translate" [clipboard-notification]="'SHARE.CLIPBOARD-MESSAGE' | translate"
[adf-clipboard] target="sharedLinkInput"> [adf-clipboard] [target]="sharedLinkInput">
link link
</mat-icon> </mat-icon>
</mat-form-field> </mat-form-field>

View File

@ -49,9 +49,11 @@ export class ClipboardDirective {
@HostListener('mouseenter') @HostListener('mouseenter')
showTooltip() { showTooltip() {
const componentFactory = this.resolver.resolveComponentFactory(ClipboardComponent); if (this.placeholder) {
const componentRef = this.viewContainerRef.createComponent(componentFactory).instance; const componentFactory = this.resolver.resolveComponentFactory(ClipboardComponent);
componentRef.placeholder = this.placeholder; const componentRef = this.viewContainerRef.createComponent(componentFactory).instance;
componentRef.placeholder = this.placeholder;
}
} }
@HostListener('mouseleave') @HostListener('mouseleave')

View File

@ -27,9 +27,7 @@ import { DataTableCellComponent } from './datatable-cell.component';
<pre <pre
class="adf-datatable-json-cell" class="adf-datatable-json-cell"
[adf-clipboard]="'CLIPBOARD.CLICK_TO_COPY'" [adf-clipboard]="'CLIPBOARD.CLICK_TO_COPY'"
[clipboard-notification]="'CLIPBOARD.SUCCESS_COPY'"> [clipboard-notification]="'CLIPBOARD.SUCCESS_COPY'">{{ value$ | async | json }}</pre>
{{ value$ | async | json }}
</pre>
</span> </span>
</ng-container> </ng-container>
<ng-template #defaultJsonTemplate> <ng-template #defaultJsonTemplate>