1 00:00:01,330 --> 00:00:02,480 Welcome back, ladies and gentlemen. 2 00:00:02,500 --> 00:00:10,150 Today, what we are going to discuss is a small problem that I run into now, going to the court at 3 00:00:10,150 --> 00:00:14,340 a movie and go here, try to change this. 4 00:00:14,860 --> 00:00:23,680 Now, some reason I disbarred, delete an update card was deleted by mistake from my my program, my 5 00:00:23,680 --> 00:00:25,210 application that I was working on. 6 00:00:25,570 --> 00:00:27,990 And I had to rewrite it here. 7 00:00:28,300 --> 00:00:35,350 So you should have this problem because we have this couple of years ago and I was trying to just delete 8 00:00:35,350 --> 00:00:36,790 something here that wasn't working. 9 00:00:37,120 --> 00:00:41,810 And I said, OK, where's where's the code that I have written for that one in this code? 10 00:00:41,830 --> 00:00:43,330 Actually, the last one was missing. 11 00:00:43,570 --> 00:00:46,090 So I just write it down again. 12 00:00:46,540 --> 00:00:51,470 Luckily, I had the the videos here to help me out. 13 00:00:51,490 --> 00:00:54,400 Now, I've noticed here one mistake that we have done. 14 00:00:54,670 --> 00:00:59,650 We just in the previous one, if it's working for you, you don't have to worry about it. 15 00:00:59,650 --> 00:01:03,250 But that matches requires two one parameters. 16 00:01:03,250 --> 00:01:04,480 And I just passed one. 17 00:01:04,660 --> 00:01:06,400 And that was this class here. 18 00:01:06,550 --> 00:01:07,960 That target in or at least. 19 00:01:07,960 --> 00:01:14,770 No, but for some reason, if it's not working for you, you can get the parent class and that is from 20 00:01:14,770 --> 00:01:19,030 the spin and just see this or any other children. 21 00:01:19,330 --> 00:01:19,720 Right. 22 00:01:20,020 --> 00:01:21,120 And it will work probably. 23 00:01:21,490 --> 00:01:24,510 So also when you click outside here. 24 00:01:24,610 --> 00:01:29,500 So when you try to update it, for example, to three and if you click here, it will not happen. 25 00:01:29,500 --> 00:01:34,920 But sometimes if you click here, it will seek to read the data set because we are trying to get that 26 00:01:34,930 --> 00:01:36,040 data set before. 27 00:01:36,220 --> 00:01:38,590 But you don't have to worry because I think so. 28 00:01:38,800 --> 00:01:40,060 I'm just check it out. 29 00:01:40,300 --> 00:01:45,040 Data that card that was working. 30 00:01:45,130 --> 00:01:45,520 Right. 31 00:01:48,680 --> 00:01:55,280 So let me check the movies, here it is, and sometimes it's not doing its job properly. 32 00:01:55,700 --> 00:01:56,540 Let's go back. 33 00:01:57,560 --> 00:02:06,260 Here it is, dirty and data that was in that movie that. 34 00:02:08,980 --> 00:02:17,170 Let's just dated a movie in here, had data that movie, the number of tickets, and it's going to be 35 00:02:17,170 --> 00:02:21,940 updated, but it takes some time to update it so that the league is working. 36 00:02:21,940 --> 00:02:22,700 Everything is working. 37 00:02:22,720 --> 00:02:24,790 So let's continue on our project. 38 00:02:24,790 --> 00:02:29,460 And that was pretty much he didn't want to just want to say here about my password. 39 00:02:29,710 --> 00:02:35,140 If in previous lecture he didn't see this, that means that I have done some problem. 40 00:02:35,380 --> 00:02:36,670 I have done some mistake. 41 00:02:36,670 --> 00:02:38,440 I just mistakenly delivered this part. 42 00:02:38,470 --> 00:02:45,590 But it's now there in in today's lecture, we're going to work on the local storage. 43 00:02:45,830 --> 00:02:50,800 So I just first going to tell you a little bit of the local storage, because we have done the local 44 00:02:50,800 --> 00:02:51,220 storage. 45 00:02:51,520 --> 00:02:58,870 And if you go back to the console, we have that local storage storage available right here, local 46 00:02:59,110 --> 00:02:59,790 storage. 47 00:03:00,160 --> 00:03:07,060 Now, the local storage here, we'll have the card, the likes and what I'm going to do here, I'm just 48 00:03:07,060 --> 00:03:08,310 going to clear it. 49 00:03:09,970 --> 00:03:14,940 And now I'm going to back to the local storage in the local storage will not have anything. 50 00:03:14,950 --> 00:03:18,700 This is because I've done different testings before, so you don't have to worry. 51 00:03:18,880 --> 00:03:21,360 So your local storage will not have anything inside. 52 00:03:21,640 --> 00:03:25,690 But you do have access to a couple of functions, methods that we used. 53 00:03:25,780 --> 00:03:31,260 We can set them, we can get them, we can clear the local storage and yeah. 54 00:03:31,270 --> 00:03:33,700 So local storage have access to these methods. 55 00:03:33,700 --> 00:03:39,880 And I'm not going to many details because remember, we have done local storage for storing our data 56 00:03:39,880 --> 00:03:43,870 back in the first project that we have done a little to do list. 57 00:03:44,260 --> 00:03:45,790 So a little bit of history. 58 00:03:45,790 --> 00:03:51,550 Local storage property allows us to access the storage object from the window object. 59 00:03:51,550 --> 00:03:51,780 Right. 60 00:03:51,940 --> 00:03:57,130 And we can store data and the BDC across browsers sessions. 61 00:03:57,520 --> 00:04:02,680 Now, local storage is similar to the storage except the storage data. 62 00:04:03,460 --> 00:04:05,650 So the data has expiration. 63 00:04:05,770 --> 00:04:09,280 But in local storage, data has not expiration time. 64 00:04:09,550 --> 00:04:13,330 And if we refresh the browser, we're not going to see any changes. 65 00:04:13,600 --> 00:04:22,660 For example, here, if I do a local storage, let's say local storage that said item and I said item, 66 00:04:22,660 --> 00:04:26,330 for example, I don't know, Rick. 67 00:04:26,380 --> 00:04:29,560 And here I will say thirty three. 68 00:04:29,800 --> 00:04:39,040 That's pretty much what I want and I can enter it now if I go to the local storage, actually local 69 00:04:39,040 --> 00:04:39,700 storage. 70 00:04:41,590 --> 00:04:49,030 So how we can grab the item so we can grab the item by saying get the item and we are grabbing the item 71 00:04:49,030 --> 00:04:55,810 by the ID the first or is the ID and we will see if that is successful. 72 00:04:56,620 --> 00:05:01,180 And because I misspelled my name, here it is. 73 00:05:01,420 --> 00:05:05,430 It will give me that year back thirty three or the second one that I put it. 74 00:05:05,620 --> 00:05:08,260 So this is how you can set items, this is how you can get item. 75 00:05:08,620 --> 00:05:14,800 The thing is that you can remove the item, for example, you can remove everything from the local storage. 76 00:05:15,280 --> 00:05:22,570 But let's first set another item and let's put Andy here and let's hear forty five. 77 00:05:23,680 --> 00:05:35,050 Now we can just remove local storage, remove item and that item, for example, needs to have the what 78 00:05:35,260 --> 00:05:36,170 needs to have the idea. 79 00:05:36,280 --> 00:05:40,570 So I know that Andy is dead, so I'm going to delete the first one. 80 00:05:40,810 --> 00:05:51,160 And now if I'm just going to see local storage get item break like this, it will not work. 81 00:05:51,160 --> 00:05:56,050 But if I see Rick or sorry if I say Andy, Andy will give me forty five. 82 00:05:56,230 --> 00:06:03,270 And the other matter you can use is local storage that clear right in it. 83 00:06:03,280 --> 00:06:04,700 It will clear anything. 84 00:06:04,720 --> 00:06:08,290 So now if you go back to the local storage it will be empty. 85 00:06:08,290 --> 00:06:09,790 So the length will be zero. 86 00:06:09,850 --> 00:06:12,490 OK, so that is how we can use the local storage. 87 00:06:12,790 --> 00:06:14,140 But why we need this. 88 00:06:14,140 --> 00:06:19,300 So we will use this for our cards, right. 89 00:06:19,330 --> 00:06:24,160 We will use it for our cart and for our like models. 90 00:06:24,430 --> 00:06:26,080 So we are going to save some data there. 91 00:06:26,260 --> 00:06:26,550 Right. 92 00:06:26,560 --> 00:06:27,940 We are going to purchase the data. 93 00:06:28,120 --> 00:06:34,390 And after we refresh here, I want to read it back from the local storage and put it back there, because 94 00:06:34,570 --> 00:06:41,140 now, for example, if I go to the movie and if I add the ticket for a movie or even if I like it, 95 00:06:41,440 --> 00:06:44,050 so are there right. 96 00:06:44,170 --> 00:06:45,070 Everything is OK. 97 00:06:45,070 --> 00:06:53,080 But if I refresh it back to zero and this is something that we don't want this something that we just 98 00:06:53,080 --> 00:06:57,790 want something to have it because we want to save some data. 99 00:06:57,850 --> 00:07:07,690 OK, now how are we going to do this back in our go back in your view, not use the model. 100 00:07:07,880 --> 00:07:14,360 So back in your cart now here, are we going to add a couple of methods and we are going to add these 101 00:07:14,360 --> 00:07:19,490 methods and we are going to test it out here with the kinds of locks, are we not we're not going to 102 00:07:19,490 --> 00:07:21,210 be able to test it out today. 103 00:07:21,650 --> 00:07:22,550 I mean, in this lecture. 104 00:07:22,550 --> 00:07:25,160 But we're going to be able to test it out, how it's working here. 105 00:07:25,250 --> 00:07:27,250 OK, so let's do something here. 106 00:07:27,260 --> 00:07:27,810 Interesting. 107 00:07:28,040 --> 00:07:29,060 So first things first. 108 00:07:29,900 --> 00:07:35,570 Now we need to create a function that will be called whenever we have some changes in these here. 109 00:07:35,810 --> 00:07:40,830 So these add item function is actually pushing on a new item into the array. 110 00:07:41,000 --> 00:07:42,150 So that is a change. 111 00:07:42,170 --> 00:07:43,900 So this array will be increased. 112 00:07:43,910 --> 00:07:44,240 Right. 113 00:07:44,630 --> 00:07:51,200 So here I want to call a function that will say persist data locally. 114 00:07:52,080 --> 00:07:52,350 Right. 115 00:07:52,430 --> 00:07:54,820 And I want to call this function from here. 116 00:07:55,220 --> 00:07:55,480 Right. 117 00:07:56,000 --> 00:08:02,260 This function will be actually created sorry, outside here. 118 00:08:02,510 --> 00:08:10,080 And what this function will do, it will actually save the data into the local storage. 119 00:08:10,220 --> 00:08:14,990 So I'm just going to write the function first test data locally. 120 00:08:15,320 --> 00:08:15,710 Right. 121 00:08:16,040 --> 00:08:20,870 And it will not take any parameters because what we're going to do, we're going to simply just see 122 00:08:20,960 --> 00:08:26,490 local storage, that set item in now because we are in a car. 123 00:08:26,780 --> 00:08:31,540 I want the key to be cart simple. 124 00:08:32,120 --> 00:08:35,300 We don't need any other keys just to cart in. 125 00:08:35,570 --> 00:08:43,070 OK, now inside I will use Jason that string if I method and I will explain you what this will do. 126 00:08:43,070 --> 00:08:49,700 So also we need to pass the entire movies item array, the array that was changed here. 127 00:08:50,060 --> 00:08:53,720 So every time we change it, we just call this one in. 128 00:08:53,720 --> 00:08:58,520 Every change is pushed back to the local storage and it's saved by the cart. 129 00:08:59,450 --> 00:09:04,090 OK, so Jason, that string inside this movie items. 130 00:09:04,310 --> 00:09:11,450 So Jason, that string of method converts a JavaScript object or a value to Jason Street and optionally 131 00:09:11,450 --> 00:09:14,570 replacing values if a replacer function is specified. 132 00:09:14,890 --> 00:09:17,150 Right now, what? 133 00:09:17,450 --> 00:09:26,480 Maybe this is not what you want to hurt, but Jesus Reavie is used to create Jesus string out of object 134 00:09:26,480 --> 00:09:32,110 or an array, and it will serialize a JavaScript object into Jaziri. 135 00:09:32,270 --> 00:09:37,390 And we do have this array here and it will make it as a string. 136 00:09:37,850 --> 00:09:44,840 Now, later on we will use a different method that we will convert these days of Stringybark back to 137 00:09:44,840 --> 00:09:46,120 something that we can use. 138 00:09:46,160 --> 00:09:46,520 Right. 139 00:09:46,700 --> 00:09:53,330 We will use that Jason parse to parse the data that we receive from adjacent object and it will serialize 140 00:09:53,330 --> 00:09:59,870 this one, serializing a JavaScript object, introduce a string and parse the other method is called 141 00:09:59,870 --> 00:10:02,300 Jason, like this force. 142 00:10:02,600 --> 00:10:04,100 And we have covered this one. 143 00:10:04,100 --> 00:10:06,210 But I just want to explain again this. 144 00:10:06,230 --> 00:10:11,510 You realize that Jayco String or whatever we have here back into JavaScript object, right? 145 00:10:12,620 --> 00:10:14,360 Because we don't want to work with the strings. 146 00:10:14,360 --> 00:10:15,910 We want to work with object. 147 00:10:16,010 --> 00:10:16,810 Okay. 148 00:10:17,060 --> 00:10:18,980 Now, for that reason, we need to run. 149 00:10:18,980 --> 00:10:29,960 Another function is that will be say, OK, the next function will be restore data so you can call whatever 150 00:10:29,960 --> 00:10:33,020 you want, restore data from local storage. 151 00:10:33,050 --> 00:10:34,850 I'm just going to say a local storage. 152 00:10:35,750 --> 00:10:38,750 And here this will actually restore the data. 153 00:10:39,080 --> 00:10:41,710 Now I'm going to create a custom variable here data. 154 00:10:41,960 --> 00:10:45,410 And this here, I'm going to use the adjacent object that I've told you. 155 00:10:45,420 --> 00:10:53,180 So this is actually going to pass the data back using this one back to a JavaScript object. 156 00:10:53,390 --> 00:10:54,410 So pass. 157 00:10:55,820 --> 00:10:56,300 Right. 158 00:10:56,550 --> 00:11:01,950 And we're going to see a local storage, that gift item. 159 00:11:02,270 --> 00:11:06,730 Now we're grabbing the item by the key, and we always know that the key will be the card. 160 00:11:08,090 --> 00:11:08,570 Nice. 161 00:11:09,560 --> 00:11:11,480 So we are done here. 162 00:11:11,810 --> 00:11:19,350 But now I have the data, as I should have, as a as a as a JavaScript object. 163 00:11:19,390 --> 00:11:21,150 What I will do with that data. 164 00:11:21,710 --> 00:11:29,450 Now, it's interesting because this method will kick in after we refresh this browser and what it will 165 00:11:29,450 --> 00:11:33,970 do, it will have a data here and it will grab it from the local storage. 166 00:11:33,980 --> 00:11:39,050 Remember, the local storage after the refreshing of the browser will still have to manage to have the 167 00:11:39,050 --> 00:11:39,680 data back. 168 00:11:39,920 --> 00:11:41,000 So it will stored here. 169 00:11:41,210 --> 00:11:44,180 And we can just simply push it back to the movies. 170 00:11:44,930 --> 00:11:50,210 Right, because the movies will be empty when we refresh it and we we say, OK, we I have something 171 00:11:50,210 --> 00:11:54,040 in the data and we can check Eve data. 172 00:11:54,590 --> 00:11:58,070 So means that if I have something then these are not movies. 173 00:11:58,070 --> 00:12:00,110 Item will be equal to the data back. 174 00:12:00,500 --> 00:12:00,900 Right. 175 00:12:01,160 --> 00:12:03,320 So I'm going to set these movies items. 176 00:12:04,580 --> 00:12:07,550 These are relate to the data and actually this data we passed the. 177 00:12:07,620 --> 00:12:15,180 Back to JavaScript object, that's first we screen, you find and we pass them back, OK, now to test 178 00:12:15,180 --> 00:12:17,490 our idea, we're not going to be able to do it right here. 179 00:12:17,640 --> 00:12:21,540 But what I'm going to do because we need to work in the controller. 180 00:12:21,940 --> 00:12:27,170 So what I'm going to do here, I'm going to just play around with the console here, if you don't mind. 181 00:12:27,810 --> 00:12:33,510 Now, for example, I'm going to search for a movie here, and we need to do a couple of changes, by 182 00:12:33,510 --> 00:12:33,770 the way. 183 00:12:34,020 --> 00:12:41,070 So if I say here data now at the moment, I will have the like movie and search. 184 00:12:41,260 --> 00:12:49,710 So this like we remember we had it last time and we had it in outside the movie controller. 185 00:12:50,640 --> 00:12:51,240 Where was it? 186 00:12:53,070 --> 00:12:53,490 Here it is. 187 00:12:53,520 --> 00:12:59,260 Data like so what I'm going to do for testing purposes, I'm going to say data that can't equal new 188 00:12:59,280 --> 00:12:59,620 card. 189 00:12:59,640 --> 00:13:03,330 Remember that card and like they have empty constructors so we can do this. 190 00:13:03,510 --> 00:13:09,870 Now, if I say data here and enter, I have like card movie and I don't have search because search is 191 00:13:09,880 --> 00:13:10,350 not created. 192 00:13:10,350 --> 00:13:11,370 You can even create search. 193 00:13:11,610 --> 00:13:12,720 You don't need that one. 194 00:13:12,930 --> 00:13:19,300 OK, so data, that card is pretty much movies, items, array that is pretty much empty. 195 00:13:20,070 --> 00:13:29,100 OK, so next thing, what we need to do is actually we can just see here we can search for a movie. 196 00:13:31,260 --> 00:13:35,930 And let me just this one search for a movie and add this one to the card. 197 00:13:36,510 --> 00:13:39,750 You know, I do have some personal data. 198 00:13:40,470 --> 00:13:42,990 Processed data locally is not defined. 199 00:13:44,970 --> 00:13:46,260 And I know what is the mistake? 200 00:13:46,260 --> 00:13:47,020 I think so. 201 00:13:47,040 --> 00:13:52,590 So we need to go back here and we need to say this, that person's data locally. 202 00:13:53,070 --> 00:13:55,410 So now it should work or. 203 00:13:55,410 --> 00:13:55,970 I hope so. 204 00:13:56,310 --> 00:13:58,410 So I'm going to start actually the movies there. 205 00:13:58,590 --> 00:14:02,700 So I'm going to add it and it will not be able to see any changes. 206 00:14:02,700 --> 00:14:04,440 It's added here nicely. 207 00:14:04,440 --> 00:14:05,400 This is working. 208 00:14:05,400 --> 00:14:14,010 So for now, if I go back to the data, that card, I know that in the card I have this movie right 209 00:14:14,250 --> 00:14:20,280 now, if I refresh it, if I go back to the data, the card, I still have access, but I don't have 210 00:14:20,580 --> 00:14:26,640 these items are movies are actually empty and I do have access because of the. 211 00:14:27,210 --> 00:14:27,810 Where was it? 212 00:14:29,930 --> 00:14:33,180 Because we just managed to do it outside of the functions, right? 213 00:14:33,560 --> 00:14:35,810 So I just feel the data card with a new card. 214 00:14:36,050 --> 00:14:36,420 Cool. 215 00:14:36,720 --> 00:14:38,720 Now, I'm going to have it one more time. 216 00:14:39,390 --> 00:14:44,330 And if I go back, I will have the movies items, array, one item. 217 00:14:44,340 --> 00:14:49,090 Right now, I just want to save this data to the local store. 218 00:14:49,140 --> 00:14:57,860 So I'm going to see here local storage, local storage, that set item. 219 00:14:58,310 --> 00:14:58,690 Right. 220 00:14:58,700 --> 00:15:01,470 So we going set the item here and I'm going to say car. 221 00:15:01,760 --> 00:15:04,190 So what we are doing, we are mimicking this part here. 222 00:15:04,760 --> 00:15:07,790 We are mimicking these purchases data locally. 223 00:15:08,090 --> 00:15:08,390 Right. 224 00:15:08,540 --> 00:15:11,060 So local storage, set item, car. 225 00:15:11,360 --> 00:15:17,390 Now I'm just going to use Jason, that string you buy again, that method in here. 226 00:15:18,440 --> 00:15:25,370 I don't have the access of these movies like I do have here with this keyword, but I do have access 227 00:15:25,370 --> 00:15:34,070 with a data dot card that so I'm going data that card in one more level down and here it is. 228 00:15:34,070 --> 00:15:35,910 It's giving me the option to put it like that. 229 00:15:36,080 --> 00:15:39,040 So make sure that you have to set to do your brackets here. 230 00:15:39,530 --> 00:15:41,090 So that's it. 231 00:15:41,090 --> 00:15:42,410 We set that data. 232 00:15:42,860 --> 00:15:47,930 Now, what we will actually do is we are I'm going to refresh here. 233 00:15:51,700 --> 00:15:56,790 And let's see if I have something in the local storage, but first let's check this one. 234 00:15:57,820 --> 00:16:00,280 So I don't have nothing in the cart here. 235 00:16:00,280 --> 00:16:00,650 Right. 236 00:16:01,750 --> 00:16:09,120 So means that it's empty and here are the local storage that so I can access the card and here it is. 237 00:16:09,130 --> 00:16:10,720 I do have access to this one. 238 00:16:11,560 --> 00:16:20,800 Now, if you use the Mozilla Firefox browser, it will give you some weird it will give you some weird 239 00:16:20,800 --> 00:16:21,460 string here. 240 00:16:21,460 --> 00:16:23,010 So I don't want to do that. 241 00:16:23,020 --> 00:16:25,360 That's why I use the chrome today. 242 00:16:25,600 --> 00:16:28,440 OK, so that is pretty much it. 243 00:16:28,450 --> 00:16:29,800 We feel that data is for now. 244 00:16:29,800 --> 00:16:34,680 If I refresh back and if I go one level, I mean again it will stay here. 245 00:16:34,690 --> 00:16:36,160 So this data is persistent. 246 00:16:36,280 --> 00:16:37,960 Back to the local storage. 247 00:16:37,960 --> 00:16:38,310 Right. 248 00:16:38,650 --> 00:16:40,360 And there you go. 249 00:16:40,370 --> 00:16:41,440 This is how are we going to do it? 250 00:16:41,710 --> 00:16:47,020 Know also what I want is that I can show you the data. 251 00:16:47,020 --> 00:16:51,340 That dot car is empty. 252 00:16:51,940 --> 00:16:52,480 Here it is. 253 00:16:52,600 --> 00:16:59,470 But how we can put it back, this data here so we can put that back, this data here, same as we did 254 00:16:59,470 --> 00:17:00,300 it like this. 255 00:17:00,310 --> 00:17:01,960 I'm just going to copy. 256 00:17:01,960 --> 00:17:03,280 I don't actually need to copy. 257 00:17:03,280 --> 00:17:10,020 I'm just going to say here, data, the card, that movie ready. 258 00:17:10,150 --> 00:17:12,910 So I do have access all of the movies items already. 259 00:17:13,060 --> 00:17:13,400 Right. 260 00:17:13,660 --> 00:17:26,770 And I will say, Jason, that pass in here, I'm going to pass the local storage, not get item in here. 261 00:17:26,770 --> 00:17:27,640 I'm going to say card. 262 00:17:29,140 --> 00:17:29,460 Oops. 263 00:17:30,620 --> 00:17:35,740 And let's be sure that we just can't close it now if I go to that car. 264 00:17:36,370 --> 00:17:37,170 Here it is. 265 00:17:37,300 --> 00:17:39,610 We have the same one that was in the storage. 266 00:17:40,270 --> 00:17:44,870 It was passed back to a JavaScript object and now it's here. 267 00:17:45,340 --> 00:17:47,140 How cool is this, ladies and gentlemen? 268 00:17:47,140 --> 00:17:48,380 So from the next lecture. 269 00:17:48,670 --> 00:17:53,170 So let me just copy these two here and we need to add them. 270 00:17:53,170 --> 00:17:55,840 One more thing to you before I forget. 271 00:17:56,380 --> 00:17:59,290 We are going to do like and we're going to add them here. 272 00:17:59,530 --> 00:18:03,730 But instead of cart here, we will need to be something else. 273 00:18:03,850 --> 00:18:04,230 What? 274 00:18:04,840 --> 00:18:06,910 So here it will be const. 275 00:18:07,870 --> 00:18:09,490 So here should be the likes. 276 00:18:09,520 --> 00:18:09,850 Right. 277 00:18:11,560 --> 00:18:19,600 Because remember we do have these likes here and I'm going to say here, OK, so likes and these that 278 00:18:19,900 --> 00:18:30,310 looks nice in here I would just say looks just like that because data Jason that pass local stories, 279 00:18:30,310 --> 00:18:32,950 get item legs in after this. 280 00:18:33,670 --> 00:18:36,630 We need to just put it back to the likes array. 281 00:18:38,710 --> 00:18:39,160 Nice. 282 00:18:39,310 --> 00:18:43,000 So everything should work now but we need to call it here. 283 00:18:44,290 --> 00:18:49,960 So these dot first, these data locally, we can even call the other one. 284 00:18:50,990 --> 00:18:51,390 Right. 285 00:18:52,870 --> 00:18:54,740 But we're going to leave that for the next picture. 286 00:18:54,770 --> 00:19:00,520 So what we have done this today, I just explained the my mistake that I have here in the controller 287 00:19:00,910 --> 00:19:06,070 and I just told you that you can use this one because that is the target. 288 00:19:06,140 --> 00:19:07,620 That just requires two parameters. 289 00:19:08,110 --> 00:19:10,630 But if it's working with the other one, you don't have to worry about it. 290 00:19:10,810 --> 00:19:16,870 And you if you have that warning from the data set that you got, it couldn't be found. 291 00:19:16,880 --> 00:19:18,250 Don't worry about that either. 292 00:19:18,700 --> 00:19:20,510 Now, that's pretty much it. 293 00:19:20,650 --> 00:19:25,210 It also what we have done, we just discussed why we're going to use the local storage, because when 294 00:19:25,210 --> 00:19:31,630 the browser is refreshed, we still going to have access to the local storage right here it is in here. 295 00:19:31,630 --> 00:19:33,460 We can say local storage, that car. 296 00:19:33,670 --> 00:19:38,380 And it will give us that thing here, because at the moment here, there are a lot of things. 297 00:19:38,380 --> 00:19:40,570 But you can access the car right away. 298 00:19:40,860 --> 00:19:44,110 OK, so that what we have done, we used to method's here. 299 00:19:44,800 --> 00:19:53,470 The first one is Jason Sreedevi that will serialize this adjacent object. 300 00:19:53,980 --> 00:19:56,890 Actually I read that we are passing into string in here. 301 00:19:56,890 --> 00:20:01,950 We need to work again when we want to restore the data back and put it back to the array. 302 00:20:02,140 --> 00:20:07,660 We need to work with real JavaScript object and we're going to use the opposite of Jesus 25, which 303 00:20:07,660 --> 00:20:09,250 will be Jason the Pass. 304 00:20:09,550 --> 00:20:22,300 And here we passing these, um, you get item by the key in keys like in this and cart in this. 305 00:20:22,450 --> 00:20:23,920 OK, next lecture. 306 00:20:23,920 --> 00:20:31,020 We should be able to work here in the index and we need to get rid of a couple of things here. 307 00:20:31,030 --> 00:20:34,720 For example, the movie controller, we don't need this too. 308 00:20:34,990 --> 00:20:37,890 So we going to put it in the in a new controller. 309 00:20:37,900 --> 00:20:43,060 Actually, it's going to be event listener and also this guy here that we were sitting at the beginning. 310 00:20:43,060 --> 00:20:43,380 Right. 311 00:20:43,930 --> 00:20:46,590 OK, I will see you in the next one.