schmelczer-dev/src/framework/primitives/implementations/anchor.ts
Schmelczer András 0429ea7f72 Add final touches
2020-01-10 20:11:10 +01:00

19 lines
429 B
TypeScript

import { Primitive } from '../primitive';
import { html, url } from '../../model/misc';
export class Anchor implements Primitive {
public constructor(
private readonly href: url,
private readonly text: string
) {}
public toHTML(): html {
return `
<a class="primitive-anchor"
href="${this.href}"
rel="noreferrer"
target="_blank"
>${this.text}</a>
`;
}
}