last day (16 days later) » 

4:31 PM
0
Q: How to bind array of objects to formGroup and formarray using angular8

BhrungarajniHi i have used reactive forms to bind array of objects to formArray, but here if i select any one item in one section and click of move to right/move to left, then the entire object has been moved from one section to other. But that functionality is working fine but i am unable to detect the chna...

 
This is a duplicate of your own question from 10 minutes ago. How to assign dynamic array of objects to formgroup using angular8
See also, your other questions about this stackoverflow.com/q/60321749/5367916 (2 days ago). stackoverflow.com/q/60303369/5367916 (4 days ago). My answer to your most recent question and the other answers and comments really should help you
 
yes but here there is no true or false option, here entire objects to be moved from one section to other, as it was of different concept, i posted
and yes with that answer only i was able to come till this step, and after this i had no way, but now trying with the controls concept as you shared few min back, will try and update you
 
There is a lot of documentation on this. Before my last answer, I had never created a dynamic array. I figured it out after reading the docs and one article. Angular is extremely well documented and constantly written about. Especially forms.
 
ya even i went through some blogs as well but it i came across static arrays and assigning values but couldnt find anything which helps to my requirement, so i posted question thinking people like you may help me out
 
@Bhrungarajni It's hard to tell what you want to achieve. Demo 1 doesn't have anything to move. Can you create a much simpler demo that demonstrates the concept rather than your actual project.
 
4:31 PM
@KurtHamilton sure i will create and update you
 
@Bhrungarajni I have a working demo where I can create controls dynamically and move them between forms. You mention you want to listen to changes - what do you want to list to exactly?
@Bhrungarajni And re-reading the question, I'm not 100% clear on what the requirements are. I think you need to add a clear list of objectives and expected output.
 
@KurtHamilton my problem is that,i have list of items getting from API, so now i want to move object from one section to other, so here without using form controls i was able to move the objects, but if i have removed or added an item to any one of the section from other, it has to say me there is someitem change
sorry for late response
like we have, this.form.valueChanges, there if there is change in the controls it detects the change so like that, i need so that i can enable edit mode, if there is change detected
 
But it still doesn't give me a clear idea of what you want to achieve. It would be far better if you put a little bit of energy inot creating a simple working demo as the starting point, with a clear set of instructions about what you want to achieve
 
yes now i am creating the demo, will share in sometime and explain clearly what i want to achieve in that, thanks a lot
 
And by simple, I mean don't include anything that isn't essential. Styling isn't essential - only functionality is. Start off with the smallest amount of data that you can use to demonstrate your problem
 
4:31 PM
@KurtHamilton i have created simple demo here stackblitz.com/edit/…
here, i tried using formArrayname and formControlName but i couldnt load the values to the list, only first item gets added and rest items will be blank
 
I only have about 10 minues, but we should refine what you want here
 
yes please tell
 
I have forked your stackblitz, and created a simple form array stackblitz.com/edit/angular-vssri8
 
yes i will check and update you right now
 
Please let me know how this should look
 
4:33 PM
yes this is correct, if i delete one item in this, will that detect?
 
I didn't add any functionality, I just want to determine a starting point
So what should happen next?
 
what you have done is what i was expecting for, now i will have one more array like this kind
i mean one more section like this, will try to create as soon as possible
 
Please fork mine
 
yes yes doing that only
 
Thanks
 
4:38 PM
my demo, i have shared, now i will add functionality to this mean while
 
I have to leave now, but it's good that you're keeping the demo simple. I will be back online a bit later. Please update this chat and I'll check in later
 
yes sure, and special thanks for you for helping me, its late night for me, if possible il try my best to be online till you are back, if not will check tomorrow
 
 
1 hour later…
5:55 PM
I hope i made my demo complicated, actually i will have 2 arrays initially, i will need to bind model and model1 initially for add new time, when i come to edit mode, i will get other set of data to be binded, and when i move one object from one section to other, that entire object will be moved. if there is any movement made, then it must reflect in this.form.valueChanges() or anything like that from which i can detect the change from that
 

  last day (16 days later) »