ipsos-components
Version:
Material Design components for Angular
24 lines (20 loc) • 607 B
text/typescript
import {Component} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
/** @title Form field theming */
({
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);
}
}