Below are the variables I am working with:
inputCity;
inputGuestNumber;
inputCapacitySelected;
inputCuisineSelected;
inputPrivacySelected;
inputVenueTypeSelected;
inputAmenitiesSelected;
inputNeighborhoodSelected;
These values may or may not have a defined value, depending on the user input in a form.
I have a function called router.navigate
which sets query parameters. If any of these variables point to an undefined or empty value, what happens to the query parameters?
onSubmit(){
this.router.navigate(['/venue-list', this.inputCity], {
queryParams:{
guestCount: this.inputGuestNumber,
countOption: this.inputCapacitySelected,
cuisineSelected:this.inputCuisineSelected,
privacySelected:this.inputPrivacySelected,
venueTypeSelected: this.inputVenueTypeSelected,
amenitiesSelected: this.inputAmenitiesSelected,
neighborhoodSelected: this.inputNeighborhoodSelected
}
});
Thank you!