Skip to content

Commit e242bda

Browse files
committed
Minor changes
1 parent 2445431 commit e242bda

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

src/app/custom-controls/components/input/input.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class CustomInputTestComponent {
1818
fdescribe('InputComponent', () => {
1919
let fixture: ComponentFixture<CustomInputTestComponent>;
2020
let component: CustomInputTestComponent;
21-
let inputElement: HTMLElement;
21+
let inputElement: any;
2222

2323
beforeEach(async(() => {
2424
TestBed.configureTestingModule({

src/app/custom-controls/components/input/input.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ export class InputComponent implements ControlValueAccessor {
3131
@Input() type: string = 'text';
3232
@Input() id: string;
3333
@Input() placeholder: string = '';
34-
@Input() showValidationResult: boolean = false;
3534

3635
@ViewChild('inputControl') private _inputControl: ElementRef;
37-
getInputControl(): ElementRef {
36+
get inputControl(): ElementRef {
3837
return this._inputControl;
3938
}
4039
private _onChange = (_: any) => {};

src/app/custom-controls/components/labeled-input/labeled-input.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ export class LabeledInputComponent implements
5050

5151
ngOnInit() {
5252
const self = this;
53-
this._input.getInputControl().nativeElement.addEventListener('change', function(event) {
53+
this._input.inputControl.nativeElement.addEventListener('change', function(event) {
5454
self._onChange(this.value);
5555
});
56-
this._input.getInputControl().nativeElement.addEventListener('keyup', function(event) {
56+
this._input.inputControl.nativeElement.addEventListener('keyup', function(event) {
5757
self._onChange(this.value);
5858
});
59-
this._input.getInputControl().nativeElement.addEventListener('blur', function(event) {
59+
this._input.inputControl.nativeElement.addEventListener('blur', function(event) {
6060
self._onTouched();
6161
});
6262
}

src/app/example-template-driven-forms/components/playground-template-driven-forms/playground-template-driven-forms.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ <h4>Template-driven Form (ngModel)</h4>
1212
[(ngModel)]="entity.field1"
1313
[type]="'text'"
1414
[id]="'field1'"
15-
[placeholder]="'Enter field1'"
16-
[showValidationResult]="false"></custom-input>
15+
[placeholder]="'Enter field1'"></custom-input>
1716

1817
<span>
1918
<strong>control:</strong> custom-labeled-input;

0 commit comments

Comments
 (0)