mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-04-14 12:25:14 +00:00
27 lines
643 B
TypeScript
27 lines
643 B
TypeScript
import { Component } from '@angular/core';
|
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
|
|
|
/** @title Form field theming */
|
|
@Component({
|
|
selector : 'form-field-theming-example',
|
|
templateUrl: 'form-field-theming-example.html',
|
|
styleUrls : ['form-field-theming-example.css']
|
|
})
|
|
export class FormFieldThemingExample
|
|
{
|
|
options: FormGroup;
|
|
|
|
constructor(fb: FormBuilder)
|
|
{
|
|
this.options = fb.group({
|
|
'color' : 'primary',
|
|
'fontSize': [16, Validators.min(10)]
|
|
});
|
|
}
|
|
|
|
getFontSize()
|
|
{
|
|
return Math.max(10, this.options.value.fontSize);
|
|
}
|
|
}
|