nowi have this this.updateAddressForm = new FormGroup({ government: new…
- User
nowi have this this.updateAddressForm = new FormGroup({ government: new FormControl('',[Validators.required]), area: new FormControl('',[Validators.required]), district: new FormControl('',[Validators.required]), streetName: new FormControl('',[Validators.required]), buildingNumber: new FormControl(''), floor: new FormControl(''), landMark: new FormControl(''), type: new FormControl(''),
code}); i want first inizilation taken from already existing data as this.updateAddressRequest = { government:this.selectedOrderCustomer.government } and when make change the new value saved in this.selectedOrderCustomer.government - Assistant
- User
updateAddress() { this.sharedService.showLoader(); this.updateAddressRequest = { streetName: this.editedStreetName, buildingNumber: this.editedBuildingNumber, floor: this.editedFloor, landMark: this.editLandmark, type: this.editType, government: this.selectedOrderCustomer.government, area: this.selectedOrderCustomer.area, district: this.selectedOrderCustomer.district, };
codethis.OrdersService.updateAddress( this.orderID, this.updateAddressRequest ).subscribe( (response: any) => { this.toastr.success(response.message, 'Success'); this.dismiss(), this.getOrderCustomer(), this.sharedService.hideLoader(); }, (err) => { if (err.status === 401) { this.toastr.error('Your session has been expired!', 'Failed', { enableHtml: true, }); } else if (err.error.violations) { for (let i = 0; i < err.error.violations.length; i++) { this.toastr.error(err.error.violations[i].message, 'Failed'); this.sharedService.hideLoader(); } } else { this.toastr.error(err.error.message, 'Failed'); } this.dismiss(); this.sharedService.hideLoader(); } ); - Assistant
- User
i have made change now i want districts of region displays depend on value of form control <select class="form-control" formControlName="government" (change)="onSelectRegion(lastSelectedRegion)"> <option *ngFor="let region of regions" [value]="region.name">{{region.name}} and onSelectRegion(selectedRegionName: any) { const selectedRegion = this.regions.find( (region: any) => region.name === selectedRegionName ); if (selectedRegion) { this.selectedDistricts = selectedRegion.district; this.selectedOrderCustomer.area = null; this.selectedOrderCustomer.district = null; this.selectedOrderCustomer.government = selectedRegion.name; this.lastSelectedRegion = selectedRegion.name;
code} else { this.selectedDistricts = []; this.selectedOrderCustomer.area = null; this.selectedOrderCustomer.district = null; }} i didn't no longer use lastselected region
- Assistant
- User
Property 'value' does not exist on type 'EventTarget'.
- Assistant