src/ng-xform/field-components/optional-tag.component.ts
Component to display optional tag
:show: Flag to control component state
selector | ng-xform-required-field-tag |
template |
|
Inputs |
horizontal
|
Default value: |
optional
|
Default value: |
import { Component, Input } from '@angular/core';
/**
* Component to display optional tag
*
* :show: Flag to control component state
*/
@Component({
selector: 'ng-xform-required-field-tag',
template: `
<small *ngIf="!horizontal && optional" style="color: gray">(optional)</small>
<span *ngIf="horizontal && !optional" style='color: red'>*</span>
`,
})
export class OptionalTagComponent {
@Input() optional = false;
@Input() horizontal = false;
}