Skip to content

Commit

Permalink
feat(package): customize the label in the search component
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyNahas committed Dec 30, 2019
1 parent 5b00c6e commit dc6e427
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div fxFlex="100">
<!--search address-->
<mat-form-field fxFlex="auto" [appearance]="appearance" [@animate]="{ value: '*', params: { y: '100%' } }">
<mat-label>Address</mat-label>
<mat-label>{{searchAddressLabel}}</mat-label>
<input
(onAutocompleteSelected)="syncAutoComplete($event)"
country="de"
Expand All @@ -18,7 +18,7 @@
<form [formGroup]="addressFormGroup" fxFlex fxLayoutGap="10px">
<div fxLayout="row" fxLayoutGap="10px">
<mat-form-field fxFlex="80" [appearance]="appearance" [@animate]="{ value: '*', params: { y: '100%' } }">
<mat-label>Street Name</mat-label>
<mat-label>{{streetNameLabel}}</mat-label>
<input
formControlName="streetName"
matInput
Expand All @@ -28,7 +28,7 @@
<!-- <mat-error>{{ 'msa.contactData.currentAddress.error' | translate }}</mat-error>-->
</mat-form-field>
<mat-form-field fxFlex="20" [appearance]="appearance" [@animate]="{ value: '*', params: { y: '100%' } }">
<mat-label>Nr.</mat-label>
<mat-label>{{streetNumberLabel}}</mat-label>
<input
formControlName="streetNumber"
matInput
Expand All @@ -40,7 +40,7 @@
</div>
<div fxLayout="row" fxLayoutGap="10px">
<mat-form-field fxFlex="20" [appearance]="appearance" [@animate]="{ value: '*', params: { y: '100%' } }">
<mat-label>PLZ</mat-label>
<mat-label>{{postalCodeLabel}}</mat-label>
<input
formControlName="postalCode"
matInput
Expand All @@ -51,7 +51,7 @@
</mat-form-field>
<div formGroupName="locality" fxFlex="auto">
<mat-form-field fxFlex="auto" [appearance]="appearance" [@animate]="{ value: '*', params: { y: '100%' } }">
<mat-label>Locality</mat-label>
<mat-label>{{localityLabel}}</mat-label>
<input
formControlName="long"
matInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,24 @@ export class MatSearchGoogleMapsAutocompleteComponent implements OnInit {
@Input()
appearance: string | Appearance = Appearance.STANDARD;

@Input()
searchAddressLabel = 'Search Address';

@Input()
streetNameLabel = 'Street';

@Input()
streetNumberLabel = 'Nr.';

@Input()
postalCodeLabel = 'PLZ';

@Input()
localityLabel = 'Locality';

@Input()
errorText: string;

@Output()

@Output()
onGermanAddressMapped: EventEmitter<GermanAddress> = new EventEmitter<GermanAddress>();
Expand Down

0 comments on commit dc6e427

Please sign in to comment.