1 00:00:00,210 --> 00:00:06,300 In this part we are going to Colorado State and Aaron into objects to convert them into an object. 2 00:00:06,300 --> 00:00:08,730 We'll make the programming more flexible. 3 00:00:08,880 --> 00:00:15,930 And in this part we are going to create the state and action not just control one controller but also 4 00:00:15,930 --> 00:00:21,210 can increment and decrement and we have different values of just one. 5 00:00:21,210 --> 00:00:28,740 So for us we go to the contact dot J S and we go to the initial state and then you off just have to 6 00:00:28,780 --> 00:00:29,620 see RocĂ­o. 7 00:00:29,640 --> 00:00:32,760 We are going to create to conquer. 8 00:00:33,480 --> 00:00:34,800 So one e conquer one 9 00:00:38,000 --> 00:00:43,770 and the other is tattoo and we can said they have different initial state. 10 00:00:43,970 --> 00:00:48,610 I think some of you may already know that we have to change something. 11 00:00:49,100 --> 00:00:51,910 We have changed the day into a counter one. 12 00:00:51,920 --> 00:00:57,260 So in order to make the Web site again we have to go to the render. 13 00:00:57,350 --> 00:00:58,630 This does not count. 14 00:00:58,640 --> 00:01:08,570 Instead we have to counter one because we already said that in the last letter that this is actually 15 00:01:08,630 --> 00:01:10,270 a state. 16 00:01:10,970 --> 00:01:14,760 So the state have kind to one and contact two now. 17 00:01:14,800 --> 00:01:18,150 So we have to at all county one. 18 00:01:18,230 --> 00:01:24,750 And now we can just use state plus one because there are two counties now. 19 00:01:24,770 --> 00:01:31,850 So we have to use dispatch operator that we already teach in the previous letter which is we turn the 20 00:01:31,850 --> 00:01:32,300 state. 21 00:01:32,780 --> 00:01:37,530 We make a copy and then we specify. 22 00:01:37,560 --> 00:01:42,780 This is the Tonto one values the state of Tonto. 23 00:01:42,780 --> 00:01:43,170 One 24 00:01:48,260 --> 00:01:55,600 plus one we will become the new Tonto one value and the same for the Tillman. 25 00:01:56,570 --> 00:02:05,410 But this time is minus one and for the on Craig instead of using dispatch increment we are going to 26 00:02:05,740 --> 00:02:09,930 also change states to object. 27 00:02:09,940 --> 00:02:20,490 We create type increment and also this will become typed decrement and this will also become typed. 28 00:02:20,710 --> 00:02:28,210 We said now instead of just action not only to check the type. 29 00:02:28,210 --> 00:02:30,970 So this is action dog type. 30 00:02:31,000 --> 00:02:35,410 Now you can track again to see whether it's still working. 31 00:02:35,410 --> 00:02:38,570 So you can see it is still work fine. 32 00:02:38,620 --> 00:02:40,980 Now we are going to create another conference. 33 00:02:40,980 --> 00:02:53,920 So we have to use a new component batch from the we had strap and in here we are going to create another 34 00:02:53,920 --> 00:02:56,110 button groups to show the content where you 35 00:03:08,590 --> 00:03:13,240 now we're deprecate this one and this one showed a counter one 36 00:03:16,050 --> 00:03:22,460 and this one so the counter to an EOD where the use of the Condor. 37 00:03:23,050 --> 00:03:34,960 Oh this is tank top counter one and this become kind of kinder to now we delete this original Dave and 38 00:03:34,960 --> 00:03:37,160 we also add a paragraph. 39 00:03:37,480 --> 00:03:45,520 Now we can see the video of two contests and we can do editing and decreasing the numbers of count of 40 00:03:45,520 --> 00:03:48,420 one. 41 00:03:48,490 --> 00:03:54,560 Now we add a new groups to control the content too. 42 00:03:55,120 --> 00:03:59,000 I think we do not need duplicate reset button. 43 00:03:59,050 --> 00:04:01,810 So we just leave one reset button here. 44 00:04:02,080 --> 00:04:05,380 And I was I or the button groups 45 00:04:08,410 --> 00:04:17,530 so to control the content to we have to add two more cases we use increment two to control the content 46 00:04:17,530 --> 00:04:24,340 two and a decrement to control the minus function of the content too. 47 00:04:24,730 --> 00:04:31,630 So here we also need to change this into content too. 48 00:04:32,590 --> 00:04:37,640 And also the function here will become increment 2 and decrement 2. 49 00:04:37,810 --> 00:04:38,890 So maybe we 50 00:04:41,600 --> 00:04:45,390 make the button more specific. 51 00:04:45,940 --> 00:04:52,170 Now you see there are new rules of button which can control the value of content too. 52 00:04:52,630 --> 00:04:59,690 And the content one still working when we pass we reset both of them back to the initial values. 53 00:04:59,710 --> 00:05:07,900 I also just mentioned that converting the essence into object is to make the program more flexible. 54 00:05:08,320 --> 00:05:12,740 Now we are going to show you why this is more flexible. 55 00:05:12,820 --> 00:05:16,160 Now with liberty and new rows of buttons. 56 00:05:16,630 --> 00:05:19,900 Now we are not just increasing the value one by one. 57 00:05:19,900 --> 00:05:25,090 Instead we are going to increase the value by five. 58 00:05:25,570 --> 00:05:33,910 So the original button still adding the value by 1 and decreasing the value by 1. 59 00:05:33,910 --> 00:05:36,340 So how can we use the East Palo. 60 00:05:36,400 --> 00:05:46,950 We have to go to the actions and instead of just using the one we have to replace it to Ashton top pay 61 00:05:46,950 --> 00:05:47,300 low 62 00:05:52,250 --> 00:05:58,030 to make it more clear we also add five as the name of the buttons. 63 00:05:58,040 --> 00:06:06,560 Now when we click on the increment five you'll see the count how one will increase by five and also 64 00:06:06,560 --> 00:06:13,500 decrease by five using the original button we'll increase one by one and pressing the reset button is 65 00:06:13,500 --> 00:06:17,540 two you can convert two contests to initial state.