Given a list of checkbox items, transfer checked items from one container to the other.
data
for the list is given in the data.ts
file.TransfersList
component that will handle the entire function.Left Container
, the box should highlight.Right Container
, the box should highlight.Arrow Buttons
are clicked, the items should move into the respective boxes. For Example, If the First Item
from the Left box is moved, it should move to the right box and should be removed from the left box -- finally should be unchecked.Container
, Checkbox
and Controls
component architecture will be helpful and clean.Click to reveal
Try using filter
javascript array methods to filter out your items.
Click to reveal
You will need to know which direction you need to move the checkboxes in. An object that conveys the direction will be helpful
Click to reveal
What if you keep track of the left and the right boxes separately? While moving, add checkboxes in one container and remove them from the other.
Click to reveal
checked: false
will help you keep track of what items are checked and not. You can modify this property on change of the checkboxes.