Skip to content
Snippets Groups Projects
Commit e754e401 authored by jojohoch's avatar jojohoch
Browse files

Add `mat-form-field` wrapper to `TextFieldComponent`

parent 4429b4f8
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,9 @@ import { DropdownComponent } from './element-components/dropdown.component';
MatRadioModule,
MatCheckboxModule,
ReactiveFormsModule,
FormsModule
FormsModule,
MatFormFieldModule,
MatInputModule
],
declarations: [
ButtonComponent,
......
......@@ -5,22 +5,24 @@ import { FormElementComponent } from '../form-element-component.directive';
@Component({
selector: 'app-text-field',
template: `
<input *ngIf="elementModel.multiline === false" matInput
placeholder="{{elementModel.placeholder}}"
[formControl]="formElementControl">
<textarea *ngIf="elementModel.multiline === true" matInput
placeholder="{{elementModel.placeholder}}"
[formControl]="formElementControl"
[style.width.px]="elementModel.width"
[style.height.px]="elementModel.height"
[style.background-color]="elementModel.backgroundColor"
[style.color]="elementModel.fontColor"
[style.font-family]="elementModel.font"
[style.font-size.px]="elementModel.fontSize"
[style.font-weight]="elementModel.bold ? 'bold' : ''"
[style.font-style]="elementModel.italic ? 'italic' : ''"
[style.text-decoration]="elementModel.underline ? 'underline' : ''">
</textarea>
<mat-form-field>
<input *ngIf="elementModel.multiline === false" matInput
placeholder="{{elementModel.placeholder}}"
[formControl]="formElementControl">
<textarea *ngIf="elementModel.multiline === true" matInput
placeholder="{{elementModel.placeholder}}"
[formControl]="formElementControl"
[style.width.px]="elementModel.width"
[style.height.px]="elementModel.height"
[style.background-color]="elementModel.backgroundColor"
[style.color]="elementModel.fontColor"
[style.font-family]="elementModel.font"
[style.font-size.px]="elementModel.fontSize"
[style.font-weight]="elementModel.bold ? 'bold' : ''"
[style.font-style]="elementModel.italic ? 'italic' : ''"
[style.text-decoration]="elementModel.underline ? 'underline' : ''">
</textarea>
</mat-form-field>
`
})
export class TextFieldComponent extends FormElementComponent {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment