nycJSorg/angular-presentation

View on GitHub
apps/codelab/src/app/components/external-link-directive/external-link-directive.directive.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Directive, Input, ElementRef } from '@angular/core';

@Directive({
  // tslint:disable-next-line
  selector: '[href]'
})
// TODO(meinou): Remove the second postfix
export class ExternalLinkDirectiveDirective {
  constructor({ nativeElement }: ElementRef) {
    nativeElement.target = '_blank';
  }
}