mirror of
				https://github.com/Redocly/redoc.git
				synced 2025-11-04 09:47:31 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			392 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			392 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
'use strict';
 | 
						|
 | 
						|
import { Directive, HostListener, ElementRef} from '@angular/core';
 | 
						|
import { Clipboard } from '../../../services/clipboard.service';
 | 
						|
 | 
						|
@Directive({
 | 
						|
  selector: '[select-on-click]'
 | 
						|
})
 | 
						|
export class SelectOnClick {
 | 
						|
  $element: any;
 | 
						|
  constructor(private element: ElementRef) {}
 | 
						|
 | 
						|
  @HostListener('click')
 | 
						|
  onClick() {
 | 
						|
    Clipboard.selectElement(this.element.nativeElement);
 | 
						|
  }
 | 
						|
}
 |