I have got shop values(array of string) from another component and saved it to localstorage. Now I want to add this values into formarray named shopIds.There will not be any input form field in HTML file. But after form sumbit shopIds are getting null. How can I do this. I am adding codes here:
ngOnInit(): void {
this.formInit();
const shopIdsStr = localStorage.getItem('cdk-shop-list');
if (shopIdsStr) {
this.shop = JSON.parse(shopIdsStr);
console.log(this.shop);
}
}
formInit = () => {
this.couponForm = new FormGroup({
shopIDs: this.formBuilder.array([this.shop]),
});
};
