1 00:00:01,830 --> 00:00:06,900 In this part we want to click the red button such that the specific cut is deleted. 2 00:00:06,900 --> 00:00:11,830 For example if we click on this button this card will be deleted. 3 00:00:12,690 --> 00:00:16,460 So now we need to create a new function. 4 00:00:16,560 --> 00:00:18,710 My name is at David handler 5 00:00:26,790 --> 00:00:30,620 in order to let we know which card is going to be the letter. 6 00:00:31,230 --> 00:00:32,610 He need to know the index. 7 00:00:33,000 --> 00:00:34,980 So we have to add the index here 8 00:00:39,100 --> 00:00:49,490 and also we are going to bind a MFA so we add a you've read this and now on delete is equal to delete 9 00:00:49,520 --> 00:00:50,450 top handler 10 00:00:55,160 --> 00:01:01,730 and since we are going to pass the index to the function so we will use the arrow function 11 00:01:10,580 --> 00:01:20,720 and we go back to the top of the S and since we are going to delete we need to buy it is by the own 12 00:01:20,720 --> 00:01:23,490 delete method too on click. 13 00:01:23,600 --> 00:01:28,170 So we will pass the Pop thought on delete. 14 00:01:28,250 --> 00:01:34,720 Now we back to the party s and go to the delete content handler and we will pass the com index 15 00:01:40,430 --> 00:01:42,540 and we want to make a copy. 16 00:01:47,600 --> 00:01:52,530 Off the cuff so we let the constant cuts copy equal to cost. 17 00:01:52,830 --> 00:01:55,810 The cost is at here. 18 00:01:56,000 --> 00:02:02,300 So after we get the index we will delete the specific one. 19 00:02:02,300 --> 00:02:03,780 So we will you think this buys 20 00:02:09,710 --> 00:02:17,860 and then reset cost. 21 00:02:18,080 --> 00:02:20,380 Now we try to delete the count. 22 00:02:20,390 --> 00:02:23,200 Nothing happened. 23 00:02:23,600 --> 00:02:24,660 Why. 24 00:02:24,680 --> 00:02:46,620 Because it tried to console lock the top copies and the cops took take a look. 25 00:02:47,030 --> 00:02:54,360 So if we click on the daily you will see both of them have the same number of cars. 26 00:02:54,620 --> 00:02:56,720 Even the car's only has two cars. 27 00:02:56,720 --> 00:03:02,150 This is because at this stage the cars also delete one card. 28 00:03:02,150 --> 00:03:04,770 This is because our race is reference type. 29 00:03:04,910 --> 00:03:11,510 So in order to really make a copy as we discussed it before we need to use the spare operator 30 00:03:14,730 --> 00:03:16,790 now we can take a look again. 31 00:03:17,290 --> 00:03:21,900 If we did it one you would see the cars. 32 00:03:21,950 --> 00:03:23,060 We did delete it. 33 00:03:23,770 --> 00:03:30,770 So the cards copy only has to talk and the cars still have free cast before set cars. 34 00:03:30,940 --> 00:03:33,380 This is how the U.S. stay work. 35 00:03:33,670 --> 00:03:39,450 If we see there a little difference of the data they will not make any changes. 36 00:03:39,640 --> 00:03:47,420 So we have to make some changes so that before the set tops the cars weaving the cars and we may have 37 00:03:47,420 --> 00:03:55,160 free cars and the cars copy only has to cost so that we will note oh there is some different. 38 00:03:55,240 --> 00:03:58,380 And then it will we render the whole page.