-
Notifications
You must be signed in to change notification settings - Fork 137
Platform: Label Component Technical Design
Deepak Kumar edited this page Dec 6, 2019
·
15 revisions
Label will be a read only text before any Form Input elements. Labels for required fields are marked with an asterisk in some colour.
<fdp-label
[id]="id"
[label]="label"
[required]="true|false"
[asteriskAlignment]="left|right"
[wrap]="true|false"
>
</fdp-label>
Example:
<fdp-form-group #fg [multiLayout]="true" [formGroup]="form">
<fdp-form-field #ff [id]="'firstName'" hint="Hint for one "
zone="zLeft" [validators]="validators">
<fdp-label [id]="id" [label]="label" [required]="true" [formControl]="l1_formControl"></fdp-label>
<fdp-input [formControl]="ff.formControl"></fdp-input>
</fdp-form-field>
</fdp-form-group>
@Component({
selector: 'app-root',
templateUrl: ''
})
export class AppComponent {
constructor() {
this.form = new FormGroup({});
this.l1_formControl = new FormControl('', [Validators.somevalidator]);
}
Setting "for" attribute for label, this should be same as corresponding Input element Id. Label Text will be set to this value.
setting display text for label. By default it will be right-aligned.
setting this value to true when if the corresponding "input Element" has mandatory value requirement. It will show *( asterisk, comes from css) in some colour(comes from css).
value will decide the position of asterisk, either left-top or right-top. It will be enabled only required flag is true. Default value will be right-top.
Setting true will wrap the content to align text with other Form Element.
N/A
N/A
N/A
- fd-form-label
- Use of fd-form-label as base of fdp-label
- Will the side of asterisk changes if
Text-alignmentchanges from right to left?