Skip to content

Commit b146632

Browse files
authored
Merge pull request #6 from legendar2/patch-1
feat(package): added additional inout to localize the component even more
2 parents 549d3a5 + b8e1608 commit b146632

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<mat-form-field class="full-width" [appearance]="appearance">
2-
<mat-label>Address</mat-label>
2+
<mat-label>{{addressLabelText}}</mat-label>
33
<input matInput
44
[(ngModel)]="address"
55
(change)="onQuery($event)"
6-
placeholder="Please enter the address"
6+
placeholder="placeholderText"
77
class="form-control"
88
#search
99
MatValidateAddress
1010
required>
1111
<mat-error *ngIf="addressSearchControl.hasError('required')">
12-
The address is <strong>required</strong>
12+
{{requiredErrorText}}
1313
</mat-error>
1414
<mat-error *ngIf="addressSearchControl.hasError('validateAddress')">
15-
The address is <strong>not valid</strong>
15+
{{invalidErrorText}}
1616
</mat-error>
1717
</mat-form-field>

src/module/component/mat-google-maps-autocomplete.component.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,19 @@ export class MatGoogleMapsAutocompleteComponent implements OnInit {
2626

2727
@ViewChild('search')
2828
public searchElementRef: ElementRef;
29-
29+
30+
@Input()
31+
addressLabelText: string = 'Address';
32+
33+
@Input()
34+
placeholderText: string = 'Please enter the address';
35+
36+
@Input()
37+
requiredErrorText: string = 'The address is <strong>required</strong>';
38+
39+
@Input()
40+
invalidErrorText: string = 'The address is <strong>not valid</strong>';
41+
3042
@Input()
3143
appearance: string | Appearance = Appearance.STANDARD;
3244

0 commit comments

Comments
 (0)