libs/permalink/src/lib/permalink-new-window/permalink-new-window.component.ts
selector | n52-permalink-new-window |
templateUrl | ./permalink-new-window.component.html |
Methods |
|
Inputs |
Outputs |
url | |
Type : string
|
|
onTriggered | |
Type : EventEmitter<void>
|
|
Public openInNewWindow |
openInNewWindow()
|
Returns :
void
|
import { Component, EventEmitter, Input, Output } from '@angular/core';
@Component({
selector: 'n52-permalink-new-window',
templateUrl: './permalink-new-window.component.html'
})
export class PermalinkNewWindowComponent {
@Input()
public url: string;
@Output()
public onTriggered: EventEmitter<void> = new EventEmitter<void>();
public openInNewWindow() {
window.open(this.url, '_blank');
this.onTriggered.emit();
}
}
<button type="button" (click)="openInNewWindow()">open in new window</button>