Angular 6 - There is a form with the request data:
requestForm = this.fb.group({ method: [''], baseUrl: [''], urlParams: new FormArray([ new FormGroup({ name: new FormControl(''), value: new FormControl('') }) ]) }); I transfer the data from the form when changing:
this.generateUri(this.requestForm.get('baseUrl').value, this.requestForm.get('urlParams').value) // Генерируем URL с параметрами generateUri(base, params) { const url = new URL(base); this.appendSearchParams(url.searchParams, params); return url.toString(); } But I don’t know how to properly implement appendSearchParams or, in this case, it’s worth using HttpParams