From 19ed988fe7e8b3b9000dba30fa0b27c3e75254c4 Mon Sep 17 00:00:00 2001 From: Anthony Nahas Date: Fri, 23 Oct 2020 23:02:29 +0200 Subject: [PATCH] fix(lib): added the ability to disable the component using reactive forms #45 --- .../src/lib/mat-select-country.component.ts | 2 +- src/app/app.component.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.ts b/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.ts index f537328..d2cefd6 100644 --- a/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.ts +++ b/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.ts @@ -158,7 +158,7 @@ export class MatSelectCountryComponent implements OnInit, OnChanges, OnDestroy, } setDisabledState?(isDisabled: boolean): void { - // throw new Error('Method not implemented.'); + this.disabled = isDisabled; } autocompleteScroll() { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 07440ce..ab8d5da 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -62,10 +62,12 @@ export class AppComponent implements OnInit { this.countryFormGroup = this.formBuilder.group({ country: [{ - name: 'Deutschland', - alpha2Code: 'DE', - alpha3Code: 'DEU', - numericCode: '276' + value: { + name: 'Deutschland', + alpha2Code: 'DE', + alpha3Code: 'DEU', + numericCode: '276' + }, disabled: false }] });