mempool/frontend/src/app/data-cy.directive.ts

14 lines
373 B
TypeScript
Raw Normal View History

2022-03-19 22:14:37 -07:00
import { Directive, ElementRef, Renderer2 } from '@angular/core';
import { environment } from '../environments/environment';
@Directive({
selector: '[data-cy]'
})
export class DataCyDirective {
constructor(private el: ElementRef, private renderer: Renderer2) {
if (environment.production) {
renderer.removeAttribute(el.nativeElement, 'data-cy');
}
}
}