]>
Commit | Line | Data |
---|---|---|
1 | import { Component, Input, OnInit } from '@angular/core' | |
2 | ||
3 | @Component({ | |
4 | selector: 'my-link', | |
5 | styleUrls: [ './link.component.scss' ], | |
6 | templateUrl: './link.component.html' | |
7 | }) | |
8 | export class LinkComponent implements OnInit { | |
9 | @Input() internalLink?: string | any[] | |
10 | ||
11 | @Input() href?: string | |
12 | @Input() target = '_self' | |
13 | ||
14 | @Input() title?: string | |
15 | ||
16 | @Input() className?: string | |
17 | @Input() inheritParentCSS = false | |
18 | ||
19 | @Input() tabindex: string | number | |
20 | ||
21 | builtClasses: string | |
22 | ||
23 | ngOnInit () { | |
24 | this.builtClasses = this.className || '' | |
25 | ||
26 | if (!this.builtClasses || this.inheritParentCSS) { | |
27 | this.builtClasses += ' inherit-parent' | |
28 | } | |
29 | } | |
30 | } |