Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- address.ts:72 Uncaught (in promise) TypeError: Cannot set property 'stateShortName' of undefined
- @bindable({ defaultBindingMode: bindingMode.twoWay }) address = new AddressDetails;
- getStateData() {
- const headers = this.authService.header();
- let stateDropdown = fetch("/api/selectData/GetStatesAndCompanyStateId", {
- method: "GET",
- headers
- })
- .then(response => response.json())
- .then(data => {
- for (const key in data.stateDropDownList) {
- this.states[key] = data.stateDropDownList[key].stateShortName;
- }
- console.log("ADDRESS get state data: ", this.address);
- console.log("data: ", data)
- this.companyStateShortName = data.companyStateShortName;
- console.log("StateShortName: ", this.companyStateShortName)
- })
- .then(() => {
- console.log("this.address.addressLocation: ", typeof this.address, this.address)
- this.address.addressLocation.stateShortName = this.companyStateShortName;
- //}
- });
- ADDRESS get state data: AddressDetails {__observers__: { … } } address1: undefinedaddress2: undefinedaddressLocation: undefined__observers__: { address1: SetterObserver, address2: SetterObserver, addressLocation: SetterObserver } get address1: ƒ()set address1: ƒ()get address2: ƒ()set address2: ƒ()get addressLocation: ƒ()set addressLocation: ƒ()__proto__: Object
- address.ts:62 data: { companyStateShortName: "VIC", stateDropDownList: Array(8) } companyStateShortName: "VIC"stateDropDownList: (8) [{ … }, { … }, { … }, { … }, { … }, { … }, { … }, { … }]__proto__: Object
- address.ts:64 StateShortName: VIC
- address.ts:71 this.address.addressLocation: object AddressDetails {__observers__: { … } }
- address.ts:72 Uncaught (in promise) TypeError: Cannot set property 'stateShortName' of undefined
- at address.ts:72
- at<anonymous>
Add Comment
Please, Sign In to add comment