From 3dd1e29d8db254656c9943b527ad2ee9d1bec4a0 Mon Sep 17 00:00:00 2001
From: legendar2 <1377131+legendar2@users.noreply.github.com>
Date: Thu, 12 Jul 2018 18:12:48 +0300
Subject: [PATCH 1/3] Please make component localizable
It would only seem fare, if labels and error messages could bee passed to component.
For example, {{labelText}}, this way I could give it proper naming and even translations.
---
.../component/mat-google-maps-autocomplete.component.html | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/module/component/mat-google-maps-autocomplete.component.html b/src/module/component/mat-google-maps-autocomplete.component.html
index 1e15ffd7..c08568b3 100644
--- a/src/module/component/mat-google-maps-autocomplete.component.html
+++ b/src/module/component/mat-google-maps-autocomplete.component.html
@@ -1,17 +1,17 @@
- Address
+ {{addressLabelText}}
- The address is required
+ {{requiredErrorText}} The address is required
- The address is not valid
+ {{invalidErrorText}} The address is not valid
From 9c3b8bd7ab1d1060e9790107dc3498c7ed1047f3 Mon Sep 17 00:00:00 2001
From: legendar2 <1377131+legendar2@users.noreply.github.com>
Date: Thu, 12 Jul 2018 18:20:24 +0300
Subject: [PATCH 2/3] Removed unnecessary text
---
.../component/mat-google-maps-autocomplete.component.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/module/component/mat-google-maps-autocomplete.component.html b/src/module/component/mat-google-maps-autocomplete.component.html
index c08568b3..7b7909b4 100644
--- a/src/module/component/mat-google-maps-autocomplete.component.html
+++ b/src/module/component/mat-google-maps-autocomplete.component.html
@@ -9,9 +9,9 @@
MatValidateAddress
required>
- {{requiredErrorText}} The address is required
+ {{requiredErrorText}}
- {{invalidErrorText}} The address is not valid
+ {{invalidErrorText}}
From b8e1608bdb7c551871516e2e50141beff7a44aa2 Mon Sep 17 00:00:00 2001
From: legendar2 <1377131+legendar2@users.noreply.github.com>
Date: Thu, 12 Jul 2018 18:26:08 +0300
Subject: [PATCH 3/3] Added necessary input fields
fixed my errors
---
.../mat-google-maps-autocomplete.component.ts | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/module/component/mat-google-maps-autocomplete.component.ts b/src/module/component/mat-google-maps-autocomplete.component.ts
index d0d3d7cc..08b2a4f5 100644
--- a/src/module/component/mat-google-maps-autocomplete.component.ts
+++ b/src/module/component/mat-google-maps-autocomplete.component.ts
@@ -26,7 +26,19 @@ export class MatGoogleMapsAutocompleteComponent implements OnInit {
@ViewChild('search')
public searchElementRef: ElementRef;
-
+
+ @Input()
+ addressLabelText: string = 'Address';
+
+ @Input()
+ placeholderText: string = 'Please enter the address';
+
+ @Input()
+ requiredErrorText: string = 'The address is required';
+
+ @Input()
+ invalidErrorText: string = 'The address is not valid';
+
@Input()
appearance: string | Appearance = Appearance.STANDARD;