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

[player] Show validation errors of spell correct elements

parent 563a9f64
No related branches found
No related tags found
No related merge requests found
...@@ -2,8 +2,8 @@ import { ...@@ -2,8 +2,8 @@ import {
Component, EventEmitter, Input, Output, ViewChild Component, EventEmitter, Input, Output, ViewChild
} from '@angular/core'; } from '@angular/core';
import { MatInput } from '@angular/material/input'; import { MatInput } from '@angular/material/input';
import { FormElementComponent } from '../../directives/form-element-component.directive';
import { SpellCorrectElement } from 'common/models/elements/input-elements/spell-correct'; import { SpellCorrectElement } from 'common/models/elements/input-elements/spell-correct';
import { FormElementComponent } from '../../directives/form-element-component.directive';
@Component({ @Component({
selector: 'aspect-spell-correct', selector: 'aspect-spell-correct',
...@@ -52,12 +52,16 @@ import { SpellCorrectElement } from 'common/models/elements/input-elements/spell ...@@ -52,12 +52,16 @@ import { SpellCorrectElement } from 'common/models/elements/input-elements/spell
(elementFormControl && elementFormControl.value === '') ? (elementFormControl && elementFormControl.value === '') ?
'line-through' : ''" 'line-through' : ''"
(click)="elementFormControl.value === null ? (click)="elementFormControl.value === null ?
inputElement.focus() : inputElement.focus() :
buttonElement.focus(); buttonElement.focus();
elementFormControl.value === null ? elementFormControl.value === null ?
(elementFormControl.setValue('')) : elementFormControl.setValue('') :
elementFormControl.setValue(null)">{{elementModel.label}} elementFormControl.setValue(null)">
{{elementModel.label}}
</button> </button>
<mat-error *ngIf="elementFormControl.errors && elementFormControl.touched">
{{elementFormControl.errors | errorTransform: elementModel}}
</mat-error>
</div> </div>
</div> </div>
`, `,
......
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