Skip to content

Commit

Permalink
fix(package): options.push is not a function fixed #104
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyNahas committed May 5, 2019
1 parent f598062 commit 2cf8d4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class MatGoogleMapsAutocompleteComponent implements OnInit {
ngOnInit(): void {
this.addressValidator.subscribe(this.onNewPlaceResult);

const options: any = {
const options: AutocompleteOptions = {
// types: ['address'],
// componentRestrictions: {country: this.country},
placeIdOnly: this.placeIdOnly,
Expand All @@ -95,9 +95,9 @@ export class MatGoogleMapsAutocompleteComponent implements OnInit {
};

// tslint:disable-next-line:no-unused-expression
this.country ? options.push({componentRestrictions: {country: this.country}}) : null;
this.country ? options.componentRestrictions = {country: this.country} : null;

This comment has been minimized.

Copy link
@AnthonyNahas

AnthonyNahas May 5, 2019

Author Member

would be the same

// tslint:disable-next-line:no-unused-expression
this.country ? options.push({types: this.types}) : null;
this.country ? options.types = this.types : null;

this.autoCompleteOptions = Object.assign(this.autoCompleteOptions, options);
this.initGoogleMapsAutocomplete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class MatGoogleMapsAutocompleteDirective implements OnInit {
ngOnInit(): void {
if (isPlatformBrowser(this.platformId)) {
this.addressValidator.subscribe(this.onNewPlaceResult);
const options: any = {
const options: AutocompleteOptions = {
// types: ['address'],
// componentRestrictions: {country: this.country},
placeIdOnly: this.placeIdOnly,
Expand All @@ -70,9 +70,9 @@ export class MatGoogleMapsAutocompleteDirective implements OnInit {
};

// tslint:disable-next-line:no-unused-expression
this.country ? options.push({componentRestrictions: {country: this.country}}) : null;
this.country ? options.componentRestrictions = {country: this.country} : null;
// tslint:disable-next-line:no-unused-expression
this.country ? options.push({types: this.types}) : null;
this.country ? options.types = this.types : null;

this.autoCompleteOptions = Object.assign(this.autoCompleteOptions, options);
this.initGoogleMapsAutocomplete();
Expand Down

0 comments on commit 2cf8d4f

Please sign in to comment.