I have used ionic-4 and ngrx
which is used to state management, when i get some data object from store(ngrx) and assign to through formControll
it isn’t assigned properly. but i assigned the same object from array of same objects it was assigned properly.can anyone explain the reason of above issue ? is there any solutions?
this.store.select(ApplicationSelectors.getAssetDetails).subscribe((assetDetails) => {
if (assetDetails && this.productMasterData$) {
this.noOfAssetsControl.setValue(assetDetails.assetDetails.noOfAssets, { emitEvent: false, onlySelf: true });
this.isVatRegisteredControl.setValue(assetDetails.assetDetails.supVatRegistered, { emitEvent: false, onlySelf: true });
const asset = this.productMasterData$.assets.findIndex(x => x.code === assetDetails.assetDetails.assetType.code);
this.assetTypeControl.setValue(this.productMasterData$.assets[asset], { emitEvent: false, onlySelf: true });
}
});
numbers are assigned properly