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