All language subtitles for [English (auto-generated)] Vue JS 3 for absolute beginners (HTML _ CSS _ Vue-Router) [ Dec 2022 ] [DownSub.com]

af Afrikaans
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bn Bengali
bs Bosnian
bg Bulgarian
ca Catalan
ceb Cebuano
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
tl Filipino
fi Finnish
fr French Download
fy Frisian
gl Galician
ka Georgian
de German
el Greek
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
km Khmer
ko Korean
ku Kurdish (Kurmanji)
ky Kyrgyz
lo Lao
la Latin
lv Latvian
lt Lithuanian
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mn Mongolian
my Myanmar (Burmese)
ne Nepali
no Norwegian
ps Pashto
fa Persian
pl Polish
pt Portuguese
pa Punjabi
ro Romanian
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
st Sesotho
sn Shona
sd Sindhi
si Sinhala
sk Slovak
sl Slovenian
so Somali
es Spanish
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
te Telugu
th Thai
tr Turkish
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
or Odia (Oriya)
rw Kinyarwanda
tk Turkmen
tt Tatar
ug Uyghur
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:00,780 --> 00:00:02,960 foreign 2 00:00:11,460 --> 00:00:15,120 some of the concepts and basic things in 3 00:00:15,120 --> 00:00:18,660 View js3 and we will be mainly focusing 4 00:00:18,660 --> 00:00:20,640 on compost 5 00:00:20,640 --> 00:00:23,820 and we will also look into view router 6 00:00:23,820 --> 00:00:26,580 see how page navigations are happening 7 00:00:26,580 --> 00:00:29,160 and we will set up some basic components 8 00:00:29,160 --> 00:00:31,980 and we will also see how we can change 9 00:00:31,980 --> 00:00:33,660 from one page to another 10 00:00:33,660 --> 00:00:35,820 even though this is only going to be 11 00:00:35,820 --> 00:00:39,239 focusing on vue.js I assume that you are 12 00:00:39,239 --> 00:00:42,840 coming from a completely uh a different 13 00:00:42,840 --> 00:00:45,239 background you have some programming 14 00:00:45,239 --> 00:00:47,719 knowledge maybe in JavaScript python or 15 00:00:47,719 --> 00:00:50,820 C sharp whatever it is but you have zero 16 00:00:50,820 --> 00:00:52,620 idea about web download so I'm just 17 00:00:52,620 --> 00:00:55,379 going to assume like that so this video 18 00:00:55,379 --> 00:00:57,120 will be something like this 19 00:00:57,120 --> 00:01:00,300 before we directly jump into view I will 20 00:01:00,300 --> 00:01:02,760 give some basic introduction or idea 21 00:01:02,760 --> 00:01:05,760 about HTML and then some basic idea 22 00:01:05,760 --> 00:01:09,000 about CSS once these two are done then 23 00:01:09,000 --> 00:01:12,080 we will finally jump into view Json 24 00:01:12,080 --> 00:01:14,640 the whole video will be split into 25 00:01:14,640 --> 00:01:16,740 different chapters in case you are 26 00:01:16,740 --> 00:01:19,500 comfortable with HTML and then about CSS 27 00:01:19,500 --> 00:01:21,180 how the project structures are all there 28 00:01:21,180 --> 00:01:23,600 you can directly jump into the future 29 00:01:23,600 --> 00:01:26,220 or you can directly jump into the view 30 00:01:26,220 --> 00:01:28,799 router which will be the last part of 31 00:01:28,799 --> 00:01:29,700 this video 32 00:01:29,700 --> 00:01:32,340 whichever you are comfortable you can 33 00:01:32,340 --> 00:01:34,979 start learning them but I will start 34 00:01:34,979 --> 00:01:37,140 from scratch I will explain about HTML 35 00:01:37,140 --> 00:01:38,880 and then about CSS and then move into 36 00:01:38,880 --> 00:01:42,240 view components and then how some basic 37 00:01:42,240 --> 00:01:44,820 right composition ABA is working and 38 00:01:44,820 --> 00:01:46,979 then finally to view router 39 00:01:46,979 --> 00:01:49,020 now that this video is about 40 00:01:49,020 --> 00:01:52,140 introduction this is not going to go in 41 00:01:52,140 --> 00:01:54,780 depth into all the composition API API 42 00:01:54,780 --> 00:01:56,540 beat again we are not going to discuss 43 00:01:56,540 --> 00:01:59,640 all the uh items or all the methods 44 00:01:59,640 --> 00:02:01,799 functions available in composition we 45 00:02:01,799 --> 00:02:04,140 are going to see very very very basic 46 00:02:04,140 --> 00:02:07,619 thing like uh on binding uh to the 47 00:02:07,619 --> 00:02:09,899 functions how the template itself is set 48 00:02:09,899 --> 00:02:12,780 up how the properties are defined how we 49 00:02:12,780 --> 00:02:13,700 are 50 00:02:13,700 --> 00:02:16,260 modifying the elements using the ref 51 00:02:16,260 --> 00:02:18,959 keyword only very basic things even the 52 00:02:18,959 --> 00:02:22,260 for each components the conditional 53 00:02:22,260 --> 00:02:24,180 rendering Loop rendering nothing is 54 00:02:24,180 --> 00:02:26,340 discussed in this video we will do a 55 00:02:26,340 --> 00:02:28,140 separate video for that but this is for 56 00:02:28,140 --> 00:02:30,360 someone who wants to know what is all 57 00:02:30,360 --> 00:02:34,020 about the view JS view 3 with the 58 00:02:34,020 --> 00:02:36,840 composition API so that said let's jump 59 00:02:36,840 --> 00:02:39,500 right away 60 00:02:40,739 --> 00:02:43,760 so we'll start with width 61 00:02:43,760 --> 00:02:47,519 the thing about most of the JavaScript 62 00:02:47,519 --> 00:02:50,120 Frameworks are that they are frequently 63 00:02:50,120 --> 00:02:53,459 evolving and many new features are being 64 00:02:53,459 --> 00:02:56,220 added frequently so whatever we are 65 00:02:56,220 --> 00:02:58,319 seeing in this video today 66 00:02:58,319 --> 00:03:01,920 may be outdated by several versions next 67 00:03:01,920 --> 00:03:04,260 month or maybe after a couple of months 68 00:03:04,260 --> 00:03:07,379 so what I suggest is whenever you are 69 00:03:07,379 --> 00:03:09,360 going to do something always look into 70 00:03:09,360 --> 00:03:11,599 the latest 71 00:03:11,599 --> 00:03:14,159 documentation from whichever framework 72 00:03:14,159 --> 00:03:16,760 that you're going to use in our 73 00:03:16,760 --> 00:03:19,739 video this uh this video we will be 74 00:03:19,739 --> 00:03:23,599 looking at who js2 ujs3 using uh Vita 75 00:03:23,599 --> 00:03:28,400 and I will use a Pina for uh 76 00:03:28,400 --> 00:03:31,680 stores and we will also use a view 77 00:03:31,680 --> 00:03:35,519 router for routing to different pages 78 00:03:35,519 --> 00:03:39,360 so first thing we let's start from here 79 00:03:39,360 --> 00:03:41,159 and you want to know how the 80 00:03:41,159 --> 00:03:43,140 documentations always go to the guide 81 00:03:43,140 --> 00:03:45,720 and getting started 82 00:03:45,720 --> 00:03:48,959 so this is where we go so create wheat 83 00:03:48,959 --> 00:03:52,560 so this one will uh create the wheat and 84 00:03:52,560 --> 00:03:55,379 you need to give a file name in case you 85 00:03:55,379 --> 00:03:57,239 are going to have 86 00:03:57,239 --> 00:04:00,959 let's start with uh going to a folder I 87 00:04:00,959 --> 00:04:02,760 will open up 88 00:04:02,760 --> 00:04:05,940 the same tutorial folder here 89 00:04:05,940 --> 00:04:08,580 you have a shortcut key press your Ctrl 90 00:04:08,580 --> 00:04:10,860 and the tilde symbol 91 00:04:10,860 --> 00:04:12,840 to open up the terminal if you are not 92 00:04:12,840 --> 00:04:15,120 able to see that go to view and this is 93 00:04:15,120 --> 00:04:16,079 the one 94 00:04:16,079 --> 00:04:18,798 control terminal 95 00:04:18,798 --> 00:04:21,720 let's say 96 00:04:21,720 --> 00:04:24,240 change directory to this and now we have 97 00:04:24,240 --> 00:04:27,300 changed the directory and once we have 98 00:04:27,300 --> 00:04:32,040 changed directory let's say npm 99 00:04:32,040 --> 00:04:34,080 create Vita 100 00:04:34,080 --> 00:04:37,380 npm create reader let us do I can copy 101 00:04:37,380 --> 00:04:39,620 this 102 00:04:39,680 --> 00:04:42,900 create read that latest 103 00:04:42,900 --> 00:04:45,180 with the file name and let's say this 104 00:04:45,180 --> 00:04:50,100 name as a view that will be UE is 105 00:04:50,100 --> 00:04:52,380 pronounced as view like a friend view 106 00:04:52,380 --> 00:04:57,180 back view top view yeah view v i e w 107 00:04:57,180 --> 00:05:00,800 3 demo 108 00:05:02,520 --> 00:05:06,240 okay so it's saying that uh okay to 109 00:05:06,240 --> 00:05:09,419 proceed yes we press enter and then 110 00:05:09,419 --> 00:05:12,240 package name is V3 demo and what do you 111 00:05:12,240 --> 00:05:13,199 want to do what 112 00:05:13,199 --> 00:05:14,820 do you want vanilla framework JavaScript 113 00:05:14,820 --> 00:05:17,460 or view or reactor and press my down 114 00:05:17,460 --> 00:05:20,340 button to choose View and you can use 115 00:05:20,340 --> 00:05:23,280 this grid to create a swelled up reactor 116 00:05:23,280 --> 00:05:25,800 reactor any kind of other 117 00:05:25,800 --> 00:05:28,259 project so let's start with View 118 00:05:28,259 --> 00:05:32,539 and we are going to look into typescript 119 00:05:32,580 --> 00:05:34,740 and there we go so we have now created 120 00:05:34,740 --> 00:05:36,060 the project 121 00:05:36,060 --> 00:05:38,759 well the good thing about all the latest 122 00:05:38,759 --> 00:05:40,860 Frameworks is that they already come 123 00:05:40,860 --> 00:05:42,840 with all the illustrations that you need 124 00:05:42,840 --> 00:05:45,120 to do like they just it's like a they 125 00:05:45,120 --> 00:05:47,720 hold your hand and 126 00:05:47,720 --> 00:05:50,520 so you need to change to the folder we 127 00:05:50,520 --> 00:05:53,160 created a folder before and then you 128 00:05:53,160 --> 00:05:54,780 need to install the node modules and 129 00:05:54,780 --> 00:05:56,880 you're going to run first let us change 130 00:05:56,880 --> 00:05:58,759 to the folder 131 00:05:58,759 --> 00:06:03,240 view 3 there well what I did I just put 132 00:06:03,240 --> 00:06:05,340 change directory and then I typed a few 133 00:06:05,340 --> 00:06:09,120 letters and pressed tab tab button will 134 00:06:09,120 --> 00:06:11,460 give me the folders if you don't want to 135 00:06:11,460 --> 00:06:12,780 press tab 136 00:06:12,780 --> 00:06:15,300 you just press Ctrl and space it gives 137 00:06:15,300 --> 00:06:17,940 both the same and now at this location 138 00:06:17,940 --> 00:06:20,820 if I go here and open I don't have any 139 00:06:20,820 --> 00:06:24,780 folder open data I want to code in this 140 00:06:24,780 --> 00:06:27,780 folder and at the same time look into 141 00:06:27,780 --> 00:06:30,780 all the projects files available here to 142 00:06:30,780 --> 00:06:32,460 do that I am going to just going to say 143 00:06:32,460 --> 00:06:36,000 code space dot which means a code in 144 00:06:36,000 --> 00:06:37,860 this location when I do this and give 145 00:06:37,860 --> 00:06:40,680 enter it will open up a new 146 00:06:40,680 --> 00:06:43,500 Visual Studio window I'm sure the code 147 00:06:43,500 --> 00:06:45,660 window let's do that 148 00:06:45,660 --> 00:06:48,419 and this one is just asking you like 149 00:06:48,419 --> 00:06:50,220 there are several things do you trust 150 00:06:50,220 --> 00:06:51,660 this folder of course address this 151 00:06:51,660 --> 00:06:54,300 folder and let us minimize the older one 152 00:06:54,300 --> 00:06:58,100 let's take up top 153 00:07:00,120 --> 00:07:03,240 this is the first time I am using a real 154 00:07:03,240 --> 00:07:07,020 J is uh so it obviously is going to ask 155 00:07:07,020 --> 00:07:09,060 me different uh extensions that are 156 00:07:09,060 --> 00:07:12,180 available let us install all the basic 157 00:07:12,180 --> 00:07:14,639 extensions we need to have slippers the 158 00:07:14,639 --> 00:07:16,380 most important thing is if you have the 159 00:07:16,380 --> 00:07:18,419 language features you will have all the 160 00:07:18,419 --> 00:07:20,880 all the um intelligence features 161 00:07:20,880 --> 00:07:22,080 available now 162 00:07:22,080 --> 00:07:25,139 let us have this and I will do one more 163 00:07:25,139 --> 00:07:27,300 thing I will just check for View and see 164 00:07:27,300 --> 00:07:28,560 if we can 165 00:07:28,560 --> 00:07:31,080 install some other items 166 00:07:31,080 --> 00:07:34,440 so syntax is there highlight is there 167 00:07:34,440 --> 00:07:36,360 I don't need a Snippets that is install 168 00:07:36,360 --> 00:07:38,340 new slippers 169 00:07:38,340 --> 00:07:40,740 and it's totally up to you whether you 170 00:07:40,740 --> 00:07:43,220 want it or not 171 00:07:49,080 --> 00:07:51,720 okay I think uh this is fine we don't 172 00:07:51,720 --> 00:07:52,680 need anymore 173 00:07:52,680 --> 00:07:55,800 these things are okay now let us go to 174 00:07:55,800 --> 00:07:58,020 the folder 175 00:07:58,020 --> 00:08:01,940 if we go to the folder here 176 00:08:04,800 --> 00:08:06,599 okay 177 00:08:06,599 --> 00:08:11,539 so this is my folder and it contains a 178 00:08:11,539 --> 00:08:14,460 SRC folder public folder assets 179 00:08:14,460 --> 00:08:16,620 components now there is one more thing 180 00:08:16,620 --> 00:08:19,379 if you want to enhance the way of your 181 00:08:19,379 --> 00:08:21,599 Visual Studio code looks you can go here 182 00:08:21,599 --> 00:08:24,720 and then you can go to file like 183 00:08:24,720 --> 00:08:26,160 something 184 00:08:26,160 --> 00:08:28,379 the default on a city if you want to 185 00:08:28,379 --> 00:08:30,000 install other items you search for 186 00:08:30,000 --> 00:08:32,640 something let me install material theme 187 00:08:32,640 --> 00:08:36,680 and we slowly gone so 188 00:08:39,020 --> 00:08:42,659 what happens when you go back now you 189 00:08:42,659 --> 00:08:44,880 can see the folder icons and you can see 190 00:08:44,880 --> 00:08:46,800 different icons associated with your 191 00:08:46,800 --> 00:08:51,899 folder so so this is um may be useful 192 00:08:51,899 --> 00:08:54,000 to visually differentiate between the 193 00:08:54,000 --> 00:08:56,339 folders different files with all those 194 00:08:56,339 --> 00:08:58,620 icons before here we go this is called 195 00:08:58,620 --> 00:09:02,040 mandatory this is still uh it's your 196 00:09:02,040 --> 00:09:04,399 choice 197 00:09:07,320 --> 00:09:09,660 before we begin anything I'm going to 198 00:09:09,660 --> 00:09:11,880 reveal this folder and then see how it 199 00:09:11,880 --> 00:09:16,459 looks right click on only any file 200 00:09:21,420 --> 00:09:24,300 revealing folder 201 00:09:24,300 --> 00:09:27,540 reveal in File Explorer so it opens up 202 00:09:27,540 --> 00:09:28,860 my 203 00:09:28,860 --> 00:09:31,860 Windows Explorer to show me 204 00:09:31,860 --> 00:09:34,440 what are present inside so this is our 205 00:09:34,440 --> 00:09:38,279 file view 3D demo and inside which we 206 00:09:38,279 --> 00:09:41,220 have some source files some public files 207 00:09:41,220 --> 00:09:44,160 so these are basically the static images 208 00:09:44,160 --> 00:09:46,560 that you will be placing here and many 209 00:09:46,560 --> 00:09:50,360 many many files are here these are all 210 00:09:50,360 --> 00:09:53,339 created by default when you use the meat 211 00:09:53,339 --> 00:09:55,320 Commander but there is one important 212 00:09:55,320 --> 00:09:57,959 thing for all the applications to like 213 00:09:57,959 --> 00:10:00,120 the view.js applications too and you 214 00:10:00,120 --> 00:10:03,420 need the node.js packages node modules 215 00:10:03,420 --> 00:10:06,240 which are nothing but if you are using 216 00:10:06,240 --> 00:10:07,320 uh 217 00:10:07,320 --> 00:10:10,500 Visual Studio or like c-sharp asp.net 218 00:10:10,500 --> 00:10:11,760 different one these are all just the 219 00:10:11,760 --> 00:10:14,820 packages packages developed by external 220 00:10:14,820 --> 00:10:17,519 parties or other developers which you 221 00:10:17,519 --> 00:10:20,459 can make use of in your application so 222 00:10:20,459 --> 00:10:23,940 view itself is a node module so without 223 00:10:23,940 --> 00:10:26,100 that package you will not be able to run 224 00:10:26,100 --> 00:10:28,800 your application so to this application 225 00:10:28,800 --> 00:10:33,200 to be done perfectly you need that 226 00:10:33,240 --> 00:10:36,260 um load modula so this is already 227 00:10:36,260 --> 00:10:38,700 explained to us in 228 00:10:38,700 --> 00:10:41,459 here after you change to the directory 229 00:10:41,459 --> 00:10:43,279 you need to install the 230 00:10:43,279 --> 00:10:45,779 npm which is the node modules and then 231 00:10:45,779 --> 00:10:48,480 you can start running before I install I 232 00:10:48,480 --> 00:10:50,160 am just going to quickly walk you 233 00:10:50,160 --> 00:10:52,380 through different folders which are 234 00:10:52,380 --> 00:10:55,260 present here let us start from this 235 00:10:55,260 --> 00:10:58,740 bottom first and foremost thing is you 236 00:10:58,740 --> 00:11:01,620 need to look into this packages.json so 237 00:11:01,620 --> 00:11:04,740 this gives you the dependencies that are 238 00:11:04,740 --> 00:11:07,079 related to this project now if you are 239 00:11:07,079 --> 00:11:09,540 using any external libraries external 240 00:11:09,540 --> 00:11:13,019 nuget package like a 3js model viewer 241 00:11:13,019 --> 00:11:14,940 whatever it is everything will be 242 00:11:14,940 --> 00:11:17,640 mentioned here so first thing let us go 243 00:11:17,640 --> 00:11:20,279 here and see so our file name is view3 244 00:11:20,279 --> 00:11:21,600 demo and 245 00:11:21,600 --> 00:11:25,140 we have some versions okay and if you 246 00:11:25,140 --> 00:11:27,959 could see there are three scripts here 247 00:11:27,959 --> 00:11:30,839 one is run sorry save development 248 00:11:30,839 --> 00:11:33,959 another is build another is preview uh 249 00:11:33,959 --> 00:11:37,800 what what it does is when you press npm 250 00:11:37,800 --> 00:11:40,560 and Then followed by this day with 251 00:11:40,560 --> 00:11:41,700 development 252 00:11:41,700 --> 00:11:46,620 this does this particular uh he just 253 00:11:46,620 --> 00:11:49,620 calls this uh or executes this whatever 254 00:11:49,620 --> 00:11:51,899 uh function or operation that is 255 00:11:51,899 --> 00:11:54,779 followed by that so uh we have 256 00:11:54,779 --> 00:11:56,579 development mode we have build and then 257 00:11:56,579 --> 00:11:58,620 we have 258 00:11:58,620 --> 00:12:01,740 and uh there are dependencies uh 259 00:12:01,740 --> 00:12:04,079 external packages for instance this 260 00:12:04,079 --> 00:12:06,360 application itself is dependent on a 261 00:12:06,360 --> 00:12:07,820 view version 262 00:12:07,820 --> 00:12:09,959 3.2.4 and the power 263 00:12:09,959 --> 00:12:11,880 and the other dependencies are 264 00:12:11,880 --> 00:12:15,720 typescript and we do so you could see 265 00:12:15,720 --> 00:12:17,040 like in case you are going to install 266 00:12:17,040 --> 00:12:18,540 something up obviously we are going to 267 00:12:18,540 --> 00:12:20,760 install router we are going to install 268 00:12:20,760 --> 00:12:23,940 Pina so everything will come up here 269 00:12:23,940 --> 00:12:26,880 you when you are going to press NP I 270 00:12:26,880 --> 00:12:29,940 will type npm uh install all the 271 00:12:29,940 --> 00:12:32,040 packages whichever is required along 272 00:12:32,040 --> 00:12:34,320 with the basic npm or node modules 273 00:12:34,320 --> 00:12:35,579 should be installed in our application 274 00:12:35,579 --> 00:12:38,519 this is time consuming it will take some 275 00:12:38,519 --> 00:12:41,160 time based upon your 276 00:12:41,160 --> 00:12:43,220 um 277 00:12:44,700 --> 00:12:47,279 sometimes based upon where you are using 278 00:12:47,279 --> 00:12:48,720 it 279 00:12:48,720 --> 00:12:51,779 at my office we are behind the proxy so 280 00:12:51,779 --> 00:12:53,639 if you are using it behind the proxy 281 00:12:53,639 --> 00:12:57,000 sometimes it doesn't work so you need to 282 00:12:57,000 --> 00:13:00,060 ensure that your Visions are your Visual 283 00:13:00,060 --> 00:13:02,940 Studio code or your npm 284 00:13:02,940 --> 00:13:06,720 uh has access via the proxy you need to 285 00:13:06,720 --> 00:13:08,399 set up the proxy you can just do some 286 00:13:08,399 --> 00:13:11,339 basic Google search to see whether I uh 287 00:13:11,339 --> 00:13:14,779 in case you are not able to 288 00:13:17,120 --> 00:13:20,160 install them so currently I assume that 289 00:13:20,160 --> 00:13:21,899 you can have access and you are not 290 00:13:21,899 --> 00:13:25,560 behind a proxy npm installed 291 00:13:25,560 --> 00:13:27,600 if you are behind the proxy you will be 292 00:13:27,600 --> 00:13:30,120 stuck here it will just show ideal tree 293 00:13:30,120 --> 00:13:32,339 build depth and then it will not go 294 00:13:32,339 --> 00:13:34,680 anywhere and you will see that there is 295 00:13:34,680 --> 00:13:37,440 some error with an action or something 296 00:13:37,440 --> 00:13:39,180 thank you 297 00:13:39,180 --> 00:13:41,459 okay there we go 298 00:13:41,459 --> 00:13:43,200 so once this is done we don't have 299 00:13:43,200 --> 00:13:44,160 anyone 300 00:13:44,160 --> 00:13:47,220 so which means uh sometimes when you are 301 00:13:47,220 --> 00:13:50,639 going to use uh old package 302 00:13:50,639 --> 00:13:53,459 like you downloaded some template from 303 00:13:53,459 --> 00:13:55,320 the internet most of the times what 304 00:13:55,320 --> 00:13:57,000 happens is some of the packages are 305 00:13:57,000 --> 00:14:00,300 outdated and out of the dependencies 306 00:14:00,300 --> 00:14:02,940 some are updated some are outdated so 307 00:14:02,940 --> 00:14:05,459 you will have like different versions 308 00:14:05,459 --> 00:14:08,060 and you will have vulnerabilities or 309 00:14:08,060 --> 00:14:11,300 those points you will have 310 00:14:11,300 --> 00:14:13,620 instructions on what to do most of the 311 00:14:13,620 --> 00:14:15,839 time you have to just audit and fix them 312 00:14:15,839 --> 00:14:17,519 but currently since we are doing it from 313 00:14:17,519 --> 00:14:19,920 scratch we don't have any issues here 314 00:14:19,920 --> 00:14:23,399 uh let us go ahead and follow what we 315 00:14:23,399 --> 00:14:25,200 need to do as a first step without doing 316 00:14:25,200 --> 00:14:28,079 anything uh we could now see that we 317 00:14:28,079 --> 00:14:29,579 have the node modules folders available 318 00:14:29,579 --> 00:14:32,700 here if I go into this folder uh the 319 00:14:32,700 --> 00:14:34,980 command actually created this node 320 00:14:34,980 --> 00:14:36,899 modules and installed whatever is 321 00:14:36,899 --> 00:14:38,639 required these are the bare minimum 322 00:14:38,639 --> 00:14:41,519 required and in case you are going to 323 00:14:41,519 --> 00:14:44,820 install something new uh it will get 324 00:14:44,820 --> 00:14:46,920 added to the dependencies like when we 325 00:14:46,920 --> 00:14:49,440 are going to install a view router and 326 00:14:49,440 --> 00:14:52,019 Pina so they will get added here and 327 00:14:52,019 --> 00:14:54,720 they will also be created folder now the 328 00:14:54,720 --> 00:14:57,480 good thing is you can also open the role 329 00:14:57,480 --> 00:14:59,699 modules and directly looking to the 330 00:14:59,699 --> 00:15:02,639 source code the JavaScript files as well 331 00:15:02,639 --> 00:15:04,139 from here 332 00:15:04,139 --> 00:15:07,079 like I can open up some files I can see 333 00:15:07,079 --> 00:15:09,060 what it's doing and I can do all those 334 00:15:09,060 --> 00:15:10,079 kind of things 335 00:15:10,079 --> 00:15:12,720 now we are not going into that 336 00:15:12,720 --> 00:15:15,480 let's start with npm 337 00:15:15,480 --> 00:15:17,699 then development so that's what is 338 00:15:17,699 --> 00:15:20,760 mentioned here right so npm run there 339 00:15:20,760 --> 00:15:23,519 let's put 340 00:15:23,519 --> 00:15:26,459 there you go so we have got this one and 341 00:15:26,459 --> 00:15:27,740 now 342 00:15:27,740 --> 00:15:31,199 5173 port and I will press Ctrl plus 343 00:15:31,199 --> 00:15:33,959 click it should open the new app in 344 00:15:33,959 --> 00:15:36,000 another location so there we go this is 345 00:15:36,000 --> 00:15:38,160 our wheat plus move application which is 346 00:15:38,160 --> 00:15:41,880 a basic counter and that looks fine 347 00:15:41,880 --> 00:15:45,139 so we have managed to initiate the 348 00:15:45,139 --> 00:15:46,760 view.js 349 00:15:46,760 --> 00:15:48,959 basic project 350 00:15:48,959 --> 00:15:51,240 now this is okay so what you need to do 351 00:15:51,240 --> 00:15:52,740 when you need to close this you can 352 00:15:52,740 --> 00:15:55,320 press this deleted so it will kill the 353 00:15:55,320 --> 00:15:57,920 terminal and your 354 00:15:57,920 --> 00:16:02,540 hosts that Port is also now released 355 00:16:03,660 --> 00:16:05,699 in case you wish to open up this one 356 00:16:05,699 --> 00:16:07,620 like when you press enter 357 00:16:07,620 --> 00:16:09,360 the ability opens up only 358 00:16:09,360 --> 00:16:12,120 if all 5173 port in case you want to 359 00:16:12,120 --> 00:16:13,199 open up 360 00:16:13,199 --> 00:16:15,000 a specific port 361 00:16:15,000 --> 00:16:19,019 all you need to do is follow up npm run 362 00:16:19,019 --> 00:16:22,380 there and remember pay attention here 363 00:16:22,380 --> 00:16:24,540 you need to First you 364 00:16:24,540 --> 00:16:27,600 two iPhones and then space another two 365 00:16:27,600 --> 00:16:30,180 iPhone support then you enter your port 366 00:16:30,180 --> 00:16:32,040 number let's say in my case 8345 367 00:16:32,040 --> 00:16:33,240 something 368 00:16:33,240 --> 00:16:35,699 press enter you will be able to open up 369 00:16:35,699 --> 00:16:39,420 in 8345 now you might be asking why I 370 00:16:39,420 --> 00:16:42,360 need a clue double or here like I cannot 371 00:16:42,360 --> 00:16:45,300 just like that go and say oh three three 372 00:16:45,300 --> 00:16:48,180 four five it will not work now 373 00:16:48,180 --> 00:16:51,000 it will directly go into the default uh 374 00:16:51,000 --> 00:16:53,220 five one seven three so in case we want 375 00:16:53,220 --> 00:16:55,519 to use your own port remember 376 00:16:55,519 --> 00:16:58,320 npm run the first templation and then 377 00:16:58,320 --> 00:17:00,839 another definition for you can't use p 378 00:17:00,839 --> 00:17:03,480 as well like a regular Port eight three 379 00:17:03,480 --> 00:17:05,640 four five or like nine thousand nine 380 00:17:05,640 --> 00:17:08,520 eight nine nine nine second press and 381 00:17:08,520 --> 00:17:12,500 open up this and it opened up in another 382 00:17:12,500 --> 00:17:16,199 window and I can directly see it here 383 00:17:16,199 --> 00:17:18,660 so now it is running in a double 384 00:17:18,660 --> 00:17:21,599 and K so this is what we need and we can 385 00:17:21,599 --> 00:17:24,419 so so far this looks fine we have now 386 00:17:24,419 --> 00:17:26,520 managed to set up that and we also know 387 00:17:26,520 --> 00:17:30,000 how to change the port that's okay 388 00:17:30,000 --> 00:17:31,919 let's next step is 389 00:17:31,919 --> 00:17:34,380 to see the other files 390 00:17:34,380 --> 00:17:36,059 we're not going to look into what it 391 00:17:36,059 --> 00:17:37,500 does now 392 00:17:37,500 --> 00:17:41,340 array also not going to this does 393 00:17:41,340 --> 00:17:43,320 all you need to know is first thing is 394 00:17:43,320 --> 00:17:45,059 you need to understand how the package 395 00:17:45,059 --> 00:17:47,419 works 396 00:17:48,059 --> 00:17:50,059 the next most important thing is your 397 00:17:50,059 --> 00:17:54,480 index.js index.html this is your entry 398 00:17:54,480 --> 00:17:55,500 point 399 00:17:55,500 --> 00:17:57,480 and your View application itself 400 00:17:57,480 --> 00:17:59,640 whatever we are going to discuss later 401 00:17:59,640 --> 00:18:03,000 internally is going to be mounted on top 402 00:18:03,000 --> 00:18:04,220 of your 403 00:18:04,220 --> 00:18:07,460 index.html in the index.html 404 00:18:07,460 --> 00:18:10,679 not too confused but just to give you a 405 00:18:10,679 --> 00:18:12,720 small hint of what we are going to see 406 00:18:12,720 --> 00:18:15,480 you see there is a 407 00:18:15,480 --> 00:18:19,020 that division here with 408 00:18:19,020 --> 00:18:24,299 ID called as app oh my God so this app 409 00:18:24,299 --> 00:18:26,700 ID is consumed or like you know like 410 00:18:26,700 --> 00:18:29,100 this is a fetched and our View 411 00:18:29,100 --> 00:18:31,980 application itself is amounted or added 412 00:18:31,980 --> 00:18:34,799 to this body here we can see that in 413 00:18:34,799 --> 00:18:36,660 half years 414 00:18:36,660 --> 00:18:40,260 um we are not in RPS the main TS we are 415 00:18:40,260 --> 00:18:42,500 mounting it on top of 416 00:18:42,500 --> 00:18:46,080 an element with this hash means that it 417 00:18:46,080 --> 00:18:49,620 denotes the ID we are mounting it on top 418 00:18:49,620 --> 00:18:54,299 of an element HTML element with this ID 419 00:18:54,299 --> 00:18:56,640 called app so that's what's happening 420 00:18:56,640 --> 00:19:00,179 here so first step uh let's try to make 421 00:19:00,179 --> 00:19:02,100 some modifications to see if your 422 00:19:02,100 --> 00:19:04,380 viewing those changes here at the same 423 00:19:04,380 --> 00:19:07,280 time I will also keep this one open okay 424 00:19:07,280 --> 00:19:10,440 what do we have here like whatever you 425 00:19:10,440 --> 00:19:13,200 see inside I have already said the app 426 00:19:13,200 --> 00:19:16,440 will be mounted on top of the division 427 00:19:16,440 --> 00:19:19,980 element or session element with ID app 428 00:19:19,980 --> 00:19:23,940 so whatever is outside is not controlled 429 00:19:23,940 --> 00:19:25,140 I repeat again 430 00:19:25,140 --> 00:19:28,980 whatever is inside this ID app is the 431 00:19:28,980 --> 00:19:31,559 one that is controlled by the view jsr 432 00:19:31,559 --> 00:19:34,919 whatever is outside is not maintained or 433 00:19:34,919 --> 00:19:36,539 controlled by video so if you add 434 00:19:36,539 --> 00:19:38,340 something here it will be completely 435 00:19:38,340 --> 00:19:40,980 outside or separated let me show you an 436 00:19:40,980 --> 00:19:43,280 example 437 00:19:43,320 --> 00:19:46,799 let's say if I put one more division 438 00:19:46,799 --> 00:19:51,600 here with saying like hello 439 00:19:52,260 --> 00:19:54,539 and the moment I press save it will 440 00:19:54,539 --> 00:19:56,880 automatically be updated here I think I 441 00:19:56,880 --> 00:19:59,460 should be seeing it on top left let's do 442 00:19:59,460 --> 00:20:01,700 save 443 00:20:02,700 --> 00:20:06,360 uh it is there it is here 444 00:20:06,360 --> 00:20:09,539 see and the reason is both of them are 445 00:20:09,539 --> 00:20:11,640 present inside the same body maybe the 446 00:20:11,640 --> 00:20:15,059 HTML CSS has the flexbox or maybe 447 00:20:15,059 --> 00:20:18,059 something else let's see okay it has a 448 00:20:18,059 --> 00:20:21,480 flex box so those are a couple of other 449 00:20:21,480 --> 00:20:23,340 things that we need to look into later 450 00:20:23,340 --> 00:20:27,000 currently we see that we have some value 451 00:20:27,000 --> 00:20:29,820 called hello here in case I have a Hello 452 00:20:29,820 --> 00:20:31,500 World 453 00:20:31,500 --> 00:20:34,140 let's save 454 00:20:34,140 --> 00:20:36,900 it is added here but this is okay like 455 00:20:36,900 --> 00:20:39,120 we are not going to look uh press our 456 00:20:39,120 --> 00:20:40,919 present we are now looking to how we are 457 00:20:40,919 --> 00:20:43,140 going to organize these things we look 458 00:20:43,140 --> 00:20:44,760 into that later 459 00:20:44,760 --> 00:20:46,559 we are doing developing the application 460 00:20:46,559 --> 00:20:49,200 so let me remove it save again it should 461 00:20:49,200 --> 00:20:50,640 be gone 462 00:20:50,640 --> 00:20:53,179 so the main the key thing that I want to 463 00:20:53,179 --> 00:20:57,240 explain here is only this ID where you 464 00:20:57,240 --> 00:21:00,240 have the app is the section or the 465 00:21:00,240 --> 00:21:02,960 division where your view is mounted or 466 00:21:02,960 --> 00:21:06,960 the children where view is controlling 467 00:21:06,960 --> 00:21:08,100 your application 468 00:21:08,100 --> 00:21:11,340 because that is specified in your main 469 00:21:11,340 --> 00:21:13,620 PSR so in case if you are using 470 00:21:13,620 --> 00:21:16,320 JavaScript we mean that JavaScript okay 471 00:21:16,320 --> 00:21:19,039 so that's it 472 00:21:20,720 --> 00:21:23,400 the next thing is we want to look into 473 00:21:23,400 --> 00:21:26,520 if I minimize the source so this is what 474 00:21:26,520 --> 00:21:29,580 we have in the external area with index 475 00:21:29,580 --> 00:21:31,260 and everything 476 00:21:31,260 --> 00:21:34,500 just take a look at the script tag here 477 00:21:34,500 --> 00:21:37,500 it says that it is loading a script from 478 00:21:37,500 --> 00:21:40,559 The Source folder and the script file is 479 00:21:40,559 --> 00:21:42,240 main.js 480 00:21:42,240 --> 00:21:45,059 if we go into the source the entry point 481 00:21:45,059 --> 00:21:47,400 or the main region where you need to 482 00:21:47,400 --> 00:21:49,860 it which is your main dot JavaScript or 483 00:21:49,860 --> 00:21:52,500 email dot typescript file 484 00:21:52,500 --> 00:21:55,860 so this is where you are importing uh 485 00:21:55,860 --> 00:21:58,919 the view components and importing some 486 00:21:58,919 --> 00:22:00,840 methods functions from you currently we 487 00:22:00,840 --> 00:22:02,700 are importing a function called as a 488 00:22:02,700 --> 00:22:06,000 create app if I hover my mouse or what 489 00:22:06,000 --> 00:22:08,940 does it say it's a constant and create 490 00:22:08,940 --> 00:22:11,460 app and it creates an app function so 491 00:22:11,460 --> 00:22:14,280 basically this creates an app this is 492 00:22:14,280 --> 00:22:16,500 followed by a DOT notation so which 493 00:22:16,500 --> 00:22:20,700 means that it is built the whole create 494 00:22:20,700 --> 00:22:24,799 app itself is kind of uh 495 00:22:25,860 --> 00:22:29,220 this is a fluent designer so there is a 496 00:22:29,220 --> 00:22:31,320 design pattern called as flu entry 497 00:22:31,320 --> 00:22:33,780 design pattern let's check what it says 498 00:22:33,780 --> 00:22:36,480 fluent the design pattern 499 00:22:36,480 --> 00:22:40,320 so what it says fluent is uh it's it's 500 00:22:40,320 --> 00:22:43,260 basically a method chain okay so what 501 00:22:43,260 --> 00:22:46,080 what happens is when you are going to 502 00:22:46,080 --> 00:22:47,900 call create app and then you won't 503 00:22:47,900 --> 00:22:50,700 create a what it returns it should be 504 00:22:50,700 --> 00:22:53,820 returning you and app and when you mount 505 00:22:53,820 --> 00:22:57,179 on top of it again it returns an app so 506 00:22:57,179 --> 00:23:00,360 you can continuously call like a DOT 507 00:23:00,360 --> 00:23:03,720 Mount dot use and whatever you do it 508 00:23:03,720 --> 00:23:06,659 again returns you the same uh create app 509 00:23:06,659 --> 00:23:08,340 component usually you will be achieving 510 00:23:08,340 --> 00:23:10,980 it with the help of returning the same 511 00:23:10,980 --> 00:23:14,340 class or the same object so it's so in a 512 00:23:14,340 --> 00:23:17,460 sense this is a fluent design where you 513 00:23:17,460 --> 00:23:19,559 can reuse it again 514 00:23:19,559 --> 00:23:21,600 if you on top of it if you put another 515 00:23:21,600 --> 00:23:24,659 user it will not work here because Mount 516 00:23:24,659 --> 00:23:27,179 is the final endpoint Mount is not 517 00:23:27,179 --> 00:23:29,159 returning performance but if you click 518 00:23:29,159 --> 00:23:31,860 here and use you do something and then 519 00:23:31,860 --> 00:23:34,500 press again you will again have mount 520 00:23:34,500 --> 00:23:37,799 so it's a fluent pattern and let's not 521 00:23:37,799 --> 00:23:40,559 talk about that now so there we have it 522 00:23:40,559 --> 00:23:43,620 like the main TS is your entry point 523 00:23:43,620 --> 00:23:46,620 in case you want to install the opinion 524 00:23:46,620 --> 00:23:50,100 uh another store or some of the core 525 00:23:50,100 --> 00:23:52,080 view components you will be doing that 526 00:23:52,080 --> 00:23:54,179 in your Main Place 527 00:23:54,179 --> 00:23:56,700 or your main JavaScript finder you will 528 00:23:56,700 --> 00:23:58,200 import them here and then you will 529 00:23:58,200 --> 00:24:01,200 ensure your View application is going to 530 00:24:01,200 --> 00:24:05,299 use it we will come back to the second 531 00:24:06,720 --> 00:24:11,960 let me create one more uh component here 532 00:24:13,080 --> 00:24:18,299 new file and let's say demo.w 533 00:24:18,299 --> 00:24:22,559 a view file usually will contain three 534 00:24:22,559 --> 00:24:24,900 parts now in this video since we are 535 00:24:24,900 --> 00:24:27,120 looking at a view of u3 I will be using 536 00:24:27,120 --> 00:24:30,840 a composition API uh you you don't have 537 00:24:30,840 --> 00:24:32,640 to be confused with the terms 538 00:24:32,640 --> 00:24:35,100 composition API options API these are 539 00:24:35,100 --> 00:24:37,919 all different methods of achieving the 540 00:24:37,919 --> 00:24:41,280 same output in my opinion composition 541 00:24:41,280 --> 00:24:43,080 API is uh 542 00:24:43,080 --> 00:24:46,620 little you know straightforward and if 543 00:24:46,620 --> 00:24:50,280 you are already using a C sharp or other 544 00:24:50,280 --> 00:24:51,900 development you you should have some 545 00:24:51,900 --> 00:24:55,280 idea how the object oriented works 546 00:24:55,280 --> 00:24:59,520 so two three things one is a template so 547 00:24:59,520 --> 00:25:01,140 this is the place where you will put 548 00:25:01,140 --> 00:25:04,260 your HTML components and another is a 549 00:25:04,260 --> 00:25:05,640 script 550 00:25:05,640 --> 00:25:07,320 uh 551 00:25:07,320 --> 00:25:10,200 you know when I press script the 552 00:25:10,200 --> 00:25:11,820 intelligence kicked in and then it 553 00:25:11,820 --> 00:25:14,820 immediately added these things okay so 554 00:25:14,820 --> 00:25:16,740 let me remove this 555 00:25:16,740 --> 00:25:22,100 and the third thing is uh you have Style 556 00:25:23,240 --> 00:25:26,880 is only for this particular component so 557 00:25:26,880 --> 00:25:28,980 let's say so there are three things one 558 00:25:28,980 --> 00:25:31,320 place where you will Define your HTML 559 00:25:31,320 --> 00:25:33,840 and then a style if you in case have 560 00:25:33,840 --> 00:25:35,820 some kind of style which is associated 561 00:25:35,820 --> 00:25:38,039 only for this template you will be using 562 00:25:38,039 --> 00:25:40,919 style scope and then a function for 563 00:25:40,919 --> 00:25:43,380 handling the way how it works so there 564 00:25:43,380 --> 00:25:46,260 are the three basic things but all your 565 00:25:46,260 --> 00:25:48,059 function everything happens 566 00:25:48,059 --> 00:25:49,679 inside one file 567 00:25:49,679 --> 00:25:54,260 so this is the way how the view 568 00:25:54,260 --> 00:25:58,460 component is structured 569 00:25:59,640 --> 00:26:02,760 now let's go back to app what do we have 570 00:26:02,760 --> 00:26:03,659 here 571 00:26:03,659 --> 00:26:07,440 we have three script template and style 572 00:26:07,440 --> 00:26:10,380 as we have already seen before that 573 00:26:10,380 --> 00:26:12,240 templates is the place where you have 574 00:26:12,240 --> 00:26:16,260 your HTML incrementations so this is the 575 00:26:16,260 --> 00:26:18,600 implementation which you are seeing on 576 00:26:18,600 --> 00:26:20,539 your screen and the right side 577 00:26:20,539 --> 00:26:23,340 how do I know that app is the one that I 578 00:26:23,340 --> 00:26:25,980 need to look into why can't I start with 579 00:26:25,980 --> 00:26:27,659 there are like hello world and other 580 00:26:27,659 --> 00:26:30,840 things for this purpose let us go into 581 00:26:30,840 --> 00:26:34,440 the mail again as I said before uh index 582 00:26:34,440 --> 00:26:37,380 in the whole View application index is 583 00:26:37,380 --> 00:26:40,860 the base or the top most like how do I 584 00:26:40,860 --> 00:26:43,260 select this is the main entry point uh 585 00:26:43,260 --> 00:26:45,360 the application itself renders this and 586 00:26:45,360 --> 00:26:48,120 opens up in your screen your browser 587 00:26:48,120 --> 00:26:52,080 inside this uh HTML how are you 588 00:26:52,080 --> 00:26:54,120 associating 589 00:26:54,120 --> 00:26:56,700 it's through this I division with an ID 590 00:26:56,700 --> 00:26:59,880 called app and this is the place where 591 00:26:59,880 --> 00:27:01,799 you are going to render your 592 00:27:01,799 --> 00:27:04,279 and if you go inside your 593 00:27:04,279 --> 00:27:07,380 Source you have the main entry point 594 00:27:07,380 --> 00:27:10,039 called main.ts so two entry points 595 00:27:10,039 --> 00:27:11,940 index.html is the entry point for your 596 00:27:11,940 --> 00:27:14,100 application itself it might differ for 597 00:27:14,100 --> 00:27:16,200 your use case in case you are building 598 00:27:16,200 --> 00:27:18,299 it from a ground up you will be using 599 00:27:18,299 --> 00:27:20,940 the syntax but in case you are going to 600 00:27:20,940 --> 00:27:23,400 use vue.js inside your existing 601 00:27:23,400 --> 00:27:25,200 application you already have a website 602 00:27:25,200 --> 00:27:27,779 and you want to use it only a small 603 00:27:27,779 --> 00:27:30,059 component then you will be directly 604 00:27:30,059 --> 00:27:32,659 importing the script and I will be 605 00:27:32,659 --> 00:27:35,159 defining some ID for some of the 606 00:27:35,159 --> 00:27:37,520 component and you will be mounting there 607 00:27:37,520 --> 00:27:40,140 but in this video we are only going to 608 00:27:40,140 --> 00:27:41,760 look at how we are building in the 609 00:27:41,760 --> 00:27:45,120 ground up so this is the entry and app 610 00:27:45,120 --> 00:27:47,460 then my interface will kick in and then 611 00:27:47,460 --> 00:27:49,860 it will create a component and it will 612 00:27:49,860 --> 00:27:51,779 mount on top of 613 00:27:51,779 --> 00:27:57,059 an element with the ID app now you see 614 00:27:57,059 --> 00:27:57,900 here 615 00:27:57,900 --> 00:28:03,539 Apple so main TS Imports the app.view 616 00:28:03,539 --> 00:28:07,559 and then it mounts into the HTML element 617 00:28:07,559 --> 00:28:11,940 with the ID app so which means main TS 618 00:28:11,940 --> 00:28:13,919 knows that we are going to import view 619 00:28:13,919 --> 00:28:17,580 but what if we want to directly uh load 620 00:28:17,580 --> 00:28:19,679 something else 621 00:28:19,679 --> 00:28:23,640 let's see what I did here now I pressed 622 00:28:23,640 --> 00:28:26,039 all the shift and down here also that 623 00:28:26,039 --> 00:28:29,220 the above line is copied below let's say 624 00:28:29,220 --> 00:28:32,039 I import hello world from 625 00:28:32,039 --> 00:28:35,120 here components 626 00:28:35,120 --> 00:28:39,120 components slash 627 00:28:40,020 --> 00:28:43,620 components right where component slash 628 00:28:43,620 --> 00:28:46,220 hello 629 00:28:50,820 --> 00:28:53,820 World Dot View 630 00:28:53,820 --> 00:28:56,940 okay so instead of mounting the app in 631 00:28:56,940 --> 00:29:01,080 case I am out hello world and press save 632 00:29:01,080 --> 00:29:03,179 I should only be seeing the hello world 633 00:29:03,179 --> 00:29:04,919 component 634 00:29:04,919 --> 00:29:07,559 so that's the way how it works you enter 635 00:29:07,559 --> 00:29:10,919 into HTML and you specify the region 636 00:29:10,919 --> 00:29:12,419 where you want to 637 00:29:12,419 --> 00:29:15,179 Mount or create your View application 638 00:29:15,179 --> 00:29:17,400 and Main themes will take care of the 639 00:29:17,400 --> 00:29:19,740 rest you import the base applique based 640 00:29:19,740 --> 00:29:21,240 view component and the base view 641 00:29:21,240 --> 00:29:23,640 component you mount on top of your HTML 642 00:29:23,640 --> 00:29:25,799 location so we are not going to look 643 00:29:25,799 --> 00:29:27,360 here I am going to press Ctrl and 644 00:29:27,360 --> 00:29:29,220 backslash so that this is commented out 645 00:29:29,220 --> 00:29:33,440 and now we will use the app 646 00:29:33,539 --> 00:29:36,480 so first point here and second Point 647 00:29:36,480 --> 00:29:38,340 into your main Pairs and third Point 648 00:29:38,340 --> 00:29:40,380 into my view so now that I know that 649 00:29:40,380 --> 00:29:41,340 view is 650 00:29:41,340 --> 00:29:43,320 we will keep it very simple and 651 00:29:43,320 --> 00:29:46,620 straightforward let view sorry the app 652 00:29:46,620 --> 00:29:50,220 Dot View be my main view component and 653 00:29:50,220 --> 00:29:52,080 all the other components whatever I want 654 00:29:52,080 --> 00:29:55,200 to build let it all be added here that's 655 00:29:55,200 --> 00:29:57,360 what I'm doing here if I go into the 656 00:29:57,360 --> 00:30:00,059 template what I am doing here I have a 657 00:30:00,059 --> 00:30:03,960 division element where I have put some 658 00:30:03,960 --> 00:30:07,320 when I say I it's not actually me it is 659 00:30:07,320 --> 00:30:10,080 the default 660 00:30:10,080 --> 00:30:13,679 um template I'm used to say I have put 661 00:30:13,679 --> 00:30:17,640 so anyhow so this is where this uh vj's 662 00:30:17,640 --> 00:30:20,279 logo is there and the view JS logo is 663 00:30:20,279 --> 00:30:23,340 there and then again we have a component 664 00:30:23,340 --> 00:30:25,020 which is we have imported from the 665 00:30:25,020 --> 00:30:26,580 component we are displaying it in the 666 00:30:26,580 --> 00:30:29,399 bottom in case I press Ctrl backslash 667 00:30:29,399 --> 00:30:31,500 and comment it out and save the bottom 668 00:30:31,500 --> 00:30:34,320 part is gone because we only have two 669 00:30:34,320 --> 00:30:36,659 items now we have the division where we 670 00:30:36,659 --> 00:30:39,840 have an image for wheat and an image for 671 00:30:39,840 --> 00:30:43,980 view JS so this is a very basic item and 672 00:30:43,980 --> 00:30:45,840 now that we know that hello world is 673 00:30:45,840 --> 00:30:47,880 there we have a commented out let us not 674 00:30:47,880 --> 00:30:49,260 do anything there we will come back to 675 00:30:49,260 --> 00:30:51,059 the components at a later stage but 676 00:30:51,059 --> 00:30:53,580 currently let us play with this one now 677 00:30:53,580 --> 00:30:56,760 script is here what is the script what 678 00:30:56,760 --> 00:30:58,500 does it say it says like this is the 679 00:30:58,500 --> 00:30:59,840 template 680 00:30:59,840 --> 00:31:03,240 and what do you mean by SRC if I'm not 681 00:31:03,240 --> 00:31:06,419 wrong this is uh the extension or it is 682 00:31:06,419 --> 00:31:09,480 called as a single file component so 683 00:31:09,480 --> 00:31:12,899 with vue.js they call this app.view as a 684 00:31:12,899 --> 00:31:15,720 single file component or an sfc which 685 00:31:15,720 --> 00:31:18,659 contains all three items style template 686 00:31:18,659 --> 00:31:20,460 and the script now okay let us remove 687 00:31:20,460 --> 00:31:22,980 this it is trying to import hello world 688 00:31:22,980 --> 00:31:25,200 but there is a Squiggy line which says 689 00:31:25,200 --> 00:31:27,360 that this is declared but not used let 690 00:31:27,360 --> 00:31:30,799 us comment it out again 691 00:31:32,419 --> 00:31:36,179 uh in case you know uh uh you don't know 692 00:31:36,179 --> 00:31:38,640 I I assume that you already know HTML in 693 00:31:38,640 --> 00:31:41,460 case you don't know HTML uh this 694 00:31:41,460 --> 00:31:46,679 division element has two values 695 00:31:46,679 --> 00:31:47,700 um 696 00:31:47,700 --> 00:31:50,279 yeah link with an image and another link 697 00:31:50,279 --> 00:31:52,380 with an image what does it do when I 698 00:31:52,380 --> 00:31:54,840 click this image with source with DOT 699 00:31:54,840 --> 00:31:59,399 SVG it opens up me opens up this with JR 700 00:31:59,399 --> 00:32:03,000 js.day website let's see okay when I do 701 00:32:03,000 --> 00:32:05,580 this it should open up view Json okay 702 00:32:05,580 --> 00:32:09,140 you want to change data 703 00:32:09,179 --> 00:32:11,399 let's try to see 704 00:32:11,399 --> 00:32:13,799 google.com 705 00:32:13,799 --> 00:32:16,200 and 706 00:32:16,200 --> 00:32:19,320 bing.com I know this is very very 707 00:32:19,320 --> 00:32:21,360 Elementary you might feel like why I'm 708 00:32:21,360 --> 00:32:25,320 doing this but when I was doing uh 709 00:32:25,320 --> 00:32:28,020 from scratch I even don't know what this 710 00:32:28,020 --> 00:32:30,000 headshot means I have no idea how 711 00:32:30,000 --> 00:32:32,640 everything works so in case you know 712 00:32:32,640 --> 00:32:35,279 everything about HTML CSS you know only 713 00:32:35,279 --> 00:32:37,740 looking into how view this works you can 714 00:32:37,740 --> 00:32:39,360 skip some of the parts and move to the 715 00:32:39,360 --> 00:32:41,880 later section but this whole video is 716 00:32:41,880 --> 00:32:45,120 for someone who has zero idea about how 717 00:32:45,120 --> 00:32:46,980 your programming works this is to just 718 00:32:46,980 --> 00:32:49,380 give an introduction so please bear with 719 00:32:49,380 --> 00:32:51,000 me so when I press this one it will open 720 00:32:51,000 --> 00:32:52,980 up Google and when it is open up 721 00:32:52,980 --> 00:32:56,240 bing.com let's try 722 00:32:56,340 --> 00:32:57,779 let's try 723 00:32:57,779 --> 00:33:00,480 bing.com so that's how it works you 724 00:33:00,480 --> 00:33:04,140 press something and you easily attach a 725 00:33:04,140 --> 00:33:06,840 where is the image coming from Source it 726 00:33:06,840 --> 00:33:10,559 is coming from V Dot SVG and you see 727 00:33:10,559 --> 00:33:12,620 there are two things 728 00:33:12,620 --> 00:33:15,960 one image is coming from assets you see 729 00:33:15,960 --> 00:33:18,960 we are also giving the relative uh 730 00:33:18,960 --> 00:33:23,399 relative path like inside this uh we are 731 00:33:23,399 --> 00:33:24,840 saying that there is a folder called 732 00:33:24,840 --> 00:33:28,380 asset and uh inside the same directory 733 00:33:28,380 --> 00:33:31,019 level wherever we are we are in 734 00:33:31,019 --> 00:33:33,600 sorry app view in the app view in the 735 00:33:33,600 --> 00:33:35,580 same level we have a folder called asset 736 00:33:35,580 --> 00:33:37,380 an inside asset we have something called 737 00:33:37,380 --> 00:33:41,159 view dot SVG okay but how come we say 738 00:33:41,159 --> 00:33:43,320 that we dot SVG without saying anything 739 00:33:43,320 --> 00:33:45,899 does that mean that this wheat is 740 00:33:45,899 --> 00:33:47,760 present in the same level now whatever 741 00:33:47,760 --> 00:33:51,799 you put in public becomes your static 742 00:33:51,799 --> 00:33:54,440 static static static 743 00:33:54,440 --> 00:33:57,899 object or should I say static resource 744 00:33:57,899 --> 00:33:59,820 you can directly call from anywhere like 745 00:33:59,820 --> 00:34:02,880 this for instance if I move this wheat 746 00:34:02,880 --> 00:34:04,220 into Assad 747 00:34:04,220 --> 00:34:07,740 yes move it should not work 748 00:34:07,740 --> 00:34:10,639 let's try 749 00:34:11,339 --> 00:34:14,820 why because it's no longer able to find 750 00:34:14,820 --> 00:34:17,460 a V Dot SVG inside the public or the 751 00:34:17,460 --> 00:34:20,879 static folder but in case I need to find 752 00:34:20,879 --> 00:34:22,918 it out then I need to give the absolute 753 00:34:22,918 --> 00:34:25,260 or a relative location I say that inside 754 00:34:25,260 --> 00:34:27,119 this I have an access folder an asset 755 00:34:27,119 --> 00:34:29,159 folder I have wheat and I press save 756 00:34:29,159 --> 00:34:30,719 then 757 00:34:30,719 --> 00:34:33,000 it comes up here 758 00:34:33,000 --> 00:34:34,918 so this is the difference when you are 759 00:34:34,918 --> 00:34:36,659 putting some assets inside your Source 760 00:34:36,659 --> 00:34:39,899 then that as a set of the resources 761 00:34:39,899 --> 00:34:43,739 available accessible only via your 762 00:34:43,739 --> 00:34:46,320 absolute or relative path but if you put 763 00:34:46,320 --> 00:34:49,619 something in paprika it is a static or a 764 00:34:49,619 --> 00:34:51,060 global resource you can directly call 765 00:34:51,060 --> 00:34:52,560 them 766 00:34:52,560 --> 00:34:55,320 it's more the folder namings are also 767 00:34:55,320 --> 00:34:57,480 not important in them whatever you want 768 00:34:57,480 --> 00:34:59,700 you can use components you want to name 769 00:34:59,700 --> 00:35:01,260 something as controls you want to name 770 00:35:01,260 --> 00:35:02,880 this as a resource it's totally up to 771 00:35:02,880 --> 00:35:06,060 you there is no restriction there let's 772 00:35:06,060 --> 00:35:08,880 move the vehicle view both to public 773 00:35:08,880 --> 00:35:09,839 move 774 00:35:09,839 --> 00:35:12,119 and in this case now if I 775 00:35:12,119 --> 00:35:14,280 save 776 00:35:14,280 --> 00:35:18,800 save save both will be lost 777 00:35:19,980 --> 00:35:22,579 foreign 778 00:35:27,240 --> 00:35:30,359 location like this save and you should 779 00:35:30,359 --> 00:35:33,660 be there perfect and that's fine and 780 00:35:33,660 --> 00:35:36,599 then you have a few more items uh so 781 00:35:36,599 --> 00:35:40,260 this is our like the basic HTML you can 782 00:35:40,260 --> 00:35:42,200 add 783 00:35:42,200 --> 00:35:46,079 image you can add a division and you 784 00:35:46,079 --> 00:35:49,040 want one more item 785 00:35:49,440 --> 00:35:51,960 um what else you really want the header 786 00:35:51,960 --> 00:35:55,560 H1 you have like six letters here 787 00:35:55,560 --> 00:35:58,260 hello world save it 788 00:35:58,260 --> 00:36:00,720 you should see now uh here hello world 789 00:36:00,720 --> 00:36:03,660 and if I say let's do one thing I will 790 00:36:03,660 --> 00:36:06,839 press alt shift and down button so I 791 00:36:06,839 --> 00:36:12,380 copy them again and again and I press H2 792 00:36:14,400 --> 00:36:17,400 H3 793 00:36:18,619 --> 00:36:20,579 F4 794 00:36:20,579 --> 00:36:22,560 let's try 795 00:36:22,560 --> 00:36:25,140 H6 796 00:36:25,140 --> 00:36:28,140 H4 797 00:36:29,700 --> 00:36:31,440 6 798 00:36:31,440 --> 00:36:33,920 save 799 00:36:34,260 --> 00:36:37,079 so it's basically the size of H1 is this 800 00:36:37,079 --> 00:36:39,780 actually is sure let's try and you also 801 00:36:39,780 --> 00:36:41,220 have 802 00:36:41,220 --> 00:36:44,599 a paragraph B 803 00:36:46,020 --> 00:36:48,560 save 804 00:36:49,020 --> 00:36:51,720 paragraph is here so basically these are 805 00:36:51,720 --> 00:36:54,420 all uh current ways of displaying the 806 00:36:54,420 --> 00:36:57,599 text and everything by default has their 807 00:36:57,599 --> 00:36:58,500 own 808 00:36:58,500 --> 00:37:02,640 styling same like Microsoft Word or any 809 00:37:02,640 --> 00:37:04,680 other word processor where you have 810 00:37:04,680 --> 00:37:06,480 different styles or template for the 811 00:37:06,480 --> 00:37:08,460 text and when you change the style of 812 00:37:08,460 --> 00:37:11,040 one item everything gets for instance I 813 00:37:11,040 --> 00:37:12,960 have a hatchimal component now let me go 814 00:37:12,960 --> 00:37:15,839 into my style and say there are three 815 00:37:15,839 --> 00:37:18,839 ways of accessing the elements I will be 816 00:37:18,839 --> 00:37:21,119 very quick and I will just quickly show 817 00:37:21,119 --> 00:37:22,920 how to access them for instance I want 818 00:37:22,920 --> 00:37:26,099 to directly access an element name like 819 00:37:26,099 --> 00:37:28,140 I have an element name called do element 820 00:37:28,140 --> 00:37:31,320 call a element called ing element called 821 00:37:31,320 --> 00:37:34,320 P so whatever there is person we inside 822 00:37:34,320 --> 00:37:36,780 this one like these are all HTML defined 823 00:37:36,780 --> 00:37:40,260 one in case you are using XML or xaml 824 00:37:40,260 --> 00:37:43,020 these are all user defined 825 00:37:43,020 --> 00:37:44,880 additional restrictions you can say like 826 00:37:44,880 --> 00:37:47,520 instead of using H1 in xaml I will 827 00:37:47,520 --> 00:37:49,800 create my own object and I will give it 828 00:37:49,800 --> 00:37:52,859 my own name uh same applies in XML as 829 00:37:52,859 --> 00:37:55,859 well it's user defined but in HTML these 830 00:37:55,859 --> 00:37:58,140 are all reserved like H1 H2 already has 831 00:37:58,140 --> 00:38:02,300 a value already has a meaning so 832 00:38:02,339 --> 00:38:05,820 so let's say here to access something 833 00:38:05,820 --> 00:38:07,740 which is already reserved I directly 834 00:38:07,740 --> 00:38:10,260 type that one within the closed bracket 835 00:38:10,260 --> 00:38:14,700 I let's say a font size and plus control 836 00:38:14,700 --> 00:38:17,099 space to see if I am able to receive 837 00:38:17,099 --> 00:38:20,220 something let's say font 838 00:38:20,220 --> 00:38:24,240 and the size font sizes 839 00:38:24,240 --> 00:38:27,380 how what do I say like 840 00:38:27,380 --> 00:38:30,119 okay first let's start with small medium 841 00:38:30,119 --> 00:38:32,099 small just say pay attention to the 842 00:38:32,099 --> 00:38:35,160 hello world on the right side press save 843 00:38:35,160 --> 00:38:37,820 foreign 844 00:38:39,900 --> 00:38:42,500 if I put absolutely 845 00:38:42,500 --> 00:38:47,579 values directly like 50 pixels 846 00:38:47,579 --> 00:38:50,099 let's see how it changes 847 00:38:50,099 --> 00:38:54,680 it changes if I put 150 pixel 848 00:38:59,820 --> 00:39:02,960 did I save it 849 00:39:03,900 --> 00:39:06,720 so the pixels are now getting uh later 850 00:39:06,720 --> 00:39:09,720 so let us do one thing remove the pixels 851 00:39:09,720 --> 00:39:13,160 and see what happens 852 00:39:14,760 --> 00:39:17,339 even this is not applied so then the 853 00:39:17,339 --> 00:39:20,700 only option I have is like to use em is 854 00:39:20,700 --> 00:39:22,859 nothing but for every application there 855 00:39:22,859 --> 00:39:27,540 will be a font size uh in word in Ms 856 00:39:27,540 --> 00:39:29,880 word terms it is like the line spacing 857 00:39:29,880 --> 00:39:31,740 we have like one times of the line 858 00:39:31,740 --> 00:39:34,560 spacing or one point five times of the 859 00:39:34,560 --> 00:39:36,960 font space finger so it's basically 860 00:39:36,960 --> 00:39:38,760 every font will have 861 00:39:38,760 --> 00:39:41,460 ah height and size and you are saying 862 00:39:41,460 --> 00:39:45,000 that two times of the font 863 00:39:45,000 --> 00:39:48,660 let's see how much big it becomes now 864 00:39:48,660 --> 00:39:51,240 let's try not to give this yeah okay so 865 00:39:51,240 --> 00:39:53,520 maybe pixel might also work in case I 866 00:39:53,520 --> 00:39:56,960 don't have no house let's see 867 00:39:58,020 --> 00:40:01,020 ah pixel is also working 868 00:40:01,020 --> 00:40:04,740 so there should be no space okay in case 869 00:40:04,740 --> 00:40:06,599 I use M 870 00:40:06,599 --> 00:40:11,420 um let's say 1.5 m 871 00:40:13,440 --> 00:40:15,859 foreign 872 00:40:17,599 --> 00:40:20,940 this is the actual font size and I'm 873 00:40:20,940 --> 00:40:23,160 saying that three times of the actual 874 00:40:23,160 --> 00:40:25,619 font size so it becomes three times 875 00:40:25,619 --> 00:40:27,720 bigger than this now something like that 876 00:40:27,720 --> 00:40:30,060 and you have different options you want 877 00:40:30,060 --> 00:40:32,820 to see press Ctrl and space you will 878 00:40:32,820 --> 00:40:34,800 have all the different properties 879 00:40:34,800 --> 00:40:36,839 methods so whatever you can access for 880 00:40:36,839 --> 00:40:41,280 this I will say foreground 881 00:40:41,520 --> 00:40:46,140 are like color Okay color is pink let me 882 00:40:46,140 --> 00:40:47,700 remove it up 883 00:40:47,700 --> 00:40:50,480 ink 884 00:40:52,140 --> 00:40:54,240 it changed to Pink maybe it's not 885 00:40:54,240 --> 00:40:57,180 visible let's say 886 00:40:57,180 --> 00:41:00,140 Indian red 887 00:41:01,079 --> 00:41:03,480 it changed to engender so that's how you 888 00:41:03,480 --> 00:41:06,060 can apply now what happens wherever you 889 00:41:06,060 --> 00:41:08,520 apply this is 890 00:41:08,520 --> 00:41:10,859 and press save 891 00:41:10,859 --> 00:41:12,980 those will also 892 00:41:12,980 --> 00:41:15,420 inherit the properties of the style 893 00:41:15,420 --> 00:41:17,400 that's how it works when you put 894 00:41:17,400 --> 00:41:19,320 something in the scope this is how it 895 00:41:19,320 --> 00:41:21,780 works it up it affects only whatever the 896 00:41:21,780 --> 00:41:24,480 elements present here let's try 897 00:41:24,480 --> 00:41:26,599 something I will go back to my 898 00:41:26,599 --> 00:41:30,119 index.html here I will put one more H1 899 00:41:30,119 --> 00:41:34,140 and I will call it as I'm parent and I 900 00:41:34,140 --> 00:41:36,900 save we saw that it was coming the left 901 00:41:36,900 --> 00:41:40,380 but you see the difference the color is 902 00:41:40,380 --> 00:41:44,339 not inherited the reason why because the 903 00:41:44,339 --> 00:41:47,220 value that you have given here is Cobra 904 00:41:47,220 --> 00:41:49,640 which means this is applicable only to 905 00:41:49,640 --> 00:41:52,680 whatever HTML element present inside 906 00:41:52,680 --> 00:41:55,260 this template remove the scope and see 907 00:41:55,260 --> 00:41:57,560 what happens 908 00:41:58,320 --> 00:42:01,740 see now this is the inheritor are taken 909 00:42:01,740 --> 00:42:04,800 back to the whole document itself this 910 00:42:04,800 --> 00:42:07,140 is not something that you need maybe you 911 00:42:07,140 --> 00:42:09,420 are building a component and you make 912 00:42:09,420 --> 00:42:11,460 some mistake like you have different 913 00:42:11,460 --> 00:42:13,980 styles you have the H1 style who are 914 00:42:13,980 --> 00:42:15,839 controlling it from different components 915 00:42:15,839 --> 00:42:18,119 and it messes up everything you don't 916 00:42:18,119 --> 00:42:20,400 need that you should not do that keep it 917 00:42:20,400 --> 00:42:21,420 scoped 918 00:42:21,420 --> 00:42:25,320 if you are a very sure that the 919 00:42:25,320 --> 00:42:27,720 style whatever you are applying should 920 00:42:27,720 --> 00:42:29,700 be applied to throughout your document 921 00:42:29,700 --> 00:42:31,560 or throughout your application or your 922 00:42:31,560 --> 00:42:33,680 website or whatever it is 923 00:42:33,680 --> 00:42:36,180 just take that 924 00:42:36,180 --> 00:42:39,480 out from the scope go to your style.css 925 00:42:39,480 --> 00:42:40,980 file 926 00:42:40,980 --> 00:42:44,119 and paste it here 927 00:42:44,160 --> 00:42:47,280 now everything 928 00:42:47,280 --> 00:42:50,940 receives it now uh some of the technical 929 00:42:50,940 --> 00:42:53,880 terms I use in the video might be 930 00:42:53,880 --> 00:42:56,940 confusing because I come from 931 00:42:56,940 --> 00:43:00,180 different development background 932 00:43:00,180 --> 00:43:02,339 I develop for mobile applications 933 00:43:02,339 --> 00:43:04,920 desktop applications and web at the same 934 00:43:04,920 --> 00:43:07,800 time so sometimes I get myself confused 935 00:43:07,800 --> 00:43:09,660 with the terminologies that I use for 936 00:43:09,660 --> 00:43:12,359 desktop I use for web and I I get 937 00:43:12,359 --> 00:43:14,940 confused with the items and I also use 938 00:43:14,940 --> 00:43:18,119 different languages for my development 939 00:43:18,119 --> 00:43:21,380 shop python 940 00:43:21,380 --> 00:43:25,440 Java C plus so most of the times 941 00:43:25,440 --> 00:43:28,260 in case I'm using multiple terms 942 00:43:28,260 --> 00:43:31,619 whichever you feel is related to you 943 00:43:31,619 --> 00:43:33,540 whichever makes sense to you just take 944 00:43:33,540 --> 00:43:34,740 that up 945 00:43:34,740 --> 00:43:37,700 so uh going back how do I know that the 946 00:43:37,700 --> 00:43:40,260 style.css file is the place where I 947 00:43:40,260 --> 00:43:42,540 should place my H1 so that it is applied 948 00:43:42,540 --> 00:43:45,300 everywhere let's check pale green now 949 00:43:45,300 --> 00:43:48,079 and Save 950 00:43:48,960 --> 00:43:50,640 huh 951 00:43:50,640 --> 00:43:53,540 let's go back to HTML 952 00:43:53,540 --> 00:43:55,140 vue.js 953 00:43:55,140 --> 00:43:57,660 what happened here 954 00:43:57,660 --> 00:44:00,560 let's refresh 955 00:44:01,099 --> 00:44:05,180 since the style is Cobra the moment I 956 00:44:05,180 --> 00:44:07,920 changed something in the style that CSS 957 00:44:07,920 --> 00:44:11,040 it is not refreshed so when something 958 00:44:11,040 --> 00:44:13,440 happens in the main file it is not 959 00:44:13,440 --> 00:44:14,940 getting refreshed immediately because 960 00:44:14,940 --> 00:44:16,980 this there is no other trigger which is 961 00:44:16,980 --> 00:44:18,720 telling the application that this 962 00:44:18,720 --> 00:44:20,640 component has changed so in such cases 963 00:44:20,640 --> 00:44:22,200 you need to refresh your app itself 964 00:44:22,200 --> 00:44:24,119 anyway in production you don't have the 965 00:44:24,119 --> 00:44:25,980 tissue when the user loads it will not 966 00:44:25,980 --> 00:44:27,599 be in problem only in the development 967 00:44:27,599 --> 00:44:29,280 when you want to see that you will be 968 00:44:29,280 --> 00:44:31,500 doing it let's try something else again 969 00:44:31,500 --> 00:44:33,660 while it may be same 970 00:44:33,660 --> 00:44:36,000 the same immediately affects how 971 00:44:36,000 --> 00:44:37,920 everything is affected now but before it 972 00:44:37,920 --> 00:44:39,839 was not affecting 973 00:44:39,839 --> 00:44:41,640 it's very weird you know 974 00:44:41,640 --> 00:44:44,099 sometimes it works sometimes you have to 975 00:44:44,099 --> 00:44:47,700 refresh so that's fine so uh coming back 976 00:44:47,700 --> 00:44:49,200 to my previous question how do I know 977 00:44:49,200 --> 00:44:51,660 the style that CSS is the one where I 978 00:44:51,660 --> 00:44:54,119 need to put it it's not because it is 979 00:44:54,119 --> 00:44:56,520 present in this SRC folder it's because 980 00:44:56,520 --> 00:45:00,119 we have already uh explained that there 981 00:45:00,119 --> 00:45:01,740 are two entry points to the application 982 00:45:01,740 --> 00:45:04,619 itself it is index.html and into the 983 00:45:04,619 --> 00:45:07,920 view itself it is main.tf let's go into 984 00:45:07,920 --> 00:45:09,720 index.html 985 00:45:09,720 --> 00:45:12,420 you see here index is the place where 986 00:45:12,420 --> 00:45:14,060 you are loading your 987 00:45:14,060 --> 00:45:17,520 main.ts inside the source I am saying 988 00:45:17,520 --> 00:45:19,560 that inside the source there is a file 989 00:45:19,560 --> 00:45:24,000 called main dot TS and lower that script 990 00:45:24,000 --> 00:45:26,460 to file so that my application adapts 991 00:45:26,460 --> 00:45:31,319 that one so index points to main.ts and 992 00:45:31,319 --> 00:45:35,760 mean that yes then loads my CSS file so 993 00:45:35,760 --> 00:45:39,480 in a way the style.css file is loaded 994 00:45:39,480 --> 00:45:42,359 into main.js and main.ts is again loaded 995 00:45:42,359 --> 00:45:46,020 as a script into this index.html so I 996 00:45:46,020 --> 00:45:49,460 know that style.cs is the place where my 997 00:45:49,460 --> 00:45:52,619 all the style should be placed if I am 998 00:45:52,619 --> 00:45:53,880 going to affect the whole application 999 00:45:53,880 --> 00:45:56,280 because this is directly loaded on top 1000 00:45:56,280 --> 00:46:00,119 of my index HTML so that's the way how I 1001 00:46:00,119 --> 00:46:02,819 know that I need to put it here 1002 00:46:02,819 --> 00:46:06,599 in here whatever I change whatever I put 1003 00:46:06,599 --> 00:46:09,660 it affects everywhere for instance let's 1004 00:46:09,660 --> 00:46:17,300 say we put hush 2 and call uh color is 1005 00:46:18,180 --> 00:46:21,540 let's take this 1006 00:46:21,540 --> 00:46:24,300 what is this 1007 00:46:24,300 --> 00:46:26,579 why do there are so many colors with 1008 00:46:26,579 --> 00:46:29,760 different names let's say gold 1009 00:46:29,760 --> 00:46:31,079 save 1010 00:46:31,079 --> 00:46:34,800 H2 becomes gold okay so this is the 1011 00:46:34,800 --> 00:46:38,700 basic idea behind the CSS but CSS is 1012 00:46:38,700 --> 00:46:41,400 like an iceberg whatever you see on 1013 00:46:41,400 --> 00:46:44,460 screen is very very uh limited and they 1014 00:46:44,460 --> 00:46:47,520 have so many things you can control uh 1015 00:46:47,520 --> 00:46:50,099 you can create 1016 00:46:50,099 --> 00:46:52,500 control the whole HTML element 1017 00:46:52,500 --> 00:46:56,839 animations you can make many many many 1018 00:46:56,839 --> 00:46:58,500 customizations 1019 00:46:58,500 --> 00:47:00,540 that cannot be explained in one video 1020 00:47:00,540 --> 00:47:04,020 but most of my applications what I do I 1021 00:47:04,020 --> 00:47:07,319 always go to the browser search for some 1022 00:47:07,319 --> 00:47:09,900 cool components and then I just copy 1023 00:47:09,900 --> 00:47:13,260 their CSS items and the modify them 1024 00:47:13,260 --> 00:47:15,960 according to reduce or else you can go 1025 00:47:15,960 --> 00:47:18,240 ahead with using uh some of the popular 1026 00:47:18,240 --> 00:47:19,800 you 1027 00:47:19,800 --> 00:47:20,839 ESS 1028 00:47:20,839 --> 00:47:24,300 items like bootstrap or Tailwind CSS 1029 00:47:24,300 --> 00:47:26,940 whatever you want but we will we will 1030 00:47:26,940 --> 00:47:28,680 see that later as well now 1031 00:47:28,680 --> 00:47:31,200 we have the main TS we have the C 1032 00:47:31,200 --> 00:47:33,300 style.css file and let's go back into 1033 00:47:33,300 --> 00:47:35,880 our app.view so now that we know how 1034 00:47:35,880 --> 00:47:38,940 this HTML element is associated with the 1035 00:47:38,940 --> 00:47:41,520 style if it is scoped then it is 1036 00:47:41,520 --> 00:47:43,740 affecting only the X percentage inside 1037 00:47:43,740 --> 00:47:45,960 this template and if it is in style it 1038 00:47:45,960 --> 00:47:49,099 affects all the elements 1039 00:47:50,040 --> 00:47:53,700 the good thing about a view 3 is you can 1040 00:47:53,700 --> 00:47:57,180 put in previous versions of view you can 1041 00:47:57,180 --> 00:47:58,920 have only one children inside the 1042 00:47:58,920 --> 00:48:02,339 template like if you put a view and 1043 00:48:02,339 --> 00:48:04,440 another div it will not work because 1044 00:48:04,440 --> 00:48:07,260 there are two children now now it works 1045 00:48:07,260 --> 00:48:08,940 previously it won't work in previous 1046 00:48:08,940 --> 00:48:10,920 versions of you now we can have multiple 1047 00:48:10,920 --> 00:48:14,240 uh children that's not a problem now 1048 00:48:14,240 --> 00:48:16,740 let's say I have a 1049 00:48:16,740 --> 00:48:19,339 do 1050 00:48:19,500 --> 00:48:21,180 and 1051 00:48:21,180 --> 00:48:24,560 now and image 1052 00:48:25,579 --> 00:48:28,800 sources let's download some image and 1053 00:48:28,800 --> 00:48:30,740 add them 1054 00:48:30,740 --> 00:48:34,140 I mean bringing anime I have added an 1055 00:48:34,140 --> 00:48:36,740 image into my assets at dragon.png 1056 00:48:36,740 --> 00:48:38,700 smaller dragon 1057 00:48:38,700 --> 00:48:41,880 image what I will do inside my demo 1058 00:48:41,880 --> 00:48:44,400 component I will say the sources where 1059 00:48:44,400 --> 00:48:45,780 is metamovie this person inside 1060 00:48:45,780 --> 00:48:48,660 component so I need to go one level up 1061 00:48:48,660 --> 00:48:50,339 into the folder if I put it in public 1062 00:48:50,339 --> 00:48:52,079 then I can directly call them so let's 1063 00:48:52,079 --> 00:48:55,740 see how we can go outside if I put dot 1064 00:48:55,740 --> 00:48:58,800 and slash I have only two items inside 1065 00:48:58,800 --> 00:49:01,440 the same directory level which is demo 1066 00:49:01,440 --> 00:49:04,079 under hello world if I put 1067 00:49:04,079 --> 00:49:08,040 to the one dot is for same directory 1068 00:49:08,040 --> 00:49:10,760 level two dot is for one level above 1069 00:49:10,760 --> 00:49:13,680 Plus in the previous level what do I 1070 00:49:13,680 --> 00:49:16,859 have let's go back here I have a app 1071 00:49:16,859 --> 00:49:19,079 here I have main TS and apart from that 1072 00:49:19,079 --> 00:49:21,900 I also have assets folder and components 1073 00:49:21,900 --> 00:49:25,680 folder so two level up one level up so 1074 00:49:25,680 --> 00:49:28,079 dot is for same level two dot is for one 1075 00:49:28,079 --> 00:49:31,260 level up one level up 1076 00:49:31,260 --> 00:49:33,599 I need a assets folder and then drag on 1077 00:49:33,599 --> 00:49:36,480 PNG and I need to give all the artists 1078 00:49:36,480 --> 00:49:38,220 for like in case the image is not home 1079 00:49:38,220 --> 00:49:42,980 what is the text I need to show I said 1080 00:49:43,380 --> 00:49:46,619 close the tab that's fine it's a very 1081 00:49:46,619 --> 00:49:48,599 straightforward and a simple one let us 1082 00:49:48,599 --> 00:49:51,660 not do anything much let's keep it very 1083 00:49:51,660 --> 00:49:54,000 very simple and I don't have a style I 1084 00:49:54,000 --> 00:49:56,359 don't have a straight 1085 00:49:56,460 --> 00:49:58,619 virtual script not from a script 1086 00:49:58,619 --> 00:50:01,500 language is equal to PS okay the reasons 1087 00:50:01,500 --> 00:50:03,599 we have used uh 1088 00:50:03,599 --> 00:50:06,900 um uh typescript when we are creating it 1089 00:50:06,900 --> 00:50:08,819 we need to specify that if we go into 1090 00:50:08,819 --> 00:50:12,180 the app view you see that script you 1091 00:50:12,180 --> 00:50:14,280 have the language is typescript if you 1092 00:50:14,280 --> 00:50:16,500 go into the arrow World also we say the 1093 00:50:16,500 --> 00:50:18,599 language that I'm going to use inside 1094 00:50:18,599 --> 00:50:22,859 descriptors are the typescript uh 1095 00:50:22,859 --> 00:50:25,260 usually if you are not using typescript 1096 00:50:25,260 --> 00:50:27,240 you don't need to set it up but let it 1097 00:50:27,240 --> 00:50:30,740 be there let us not do anything now let 1098 00:50:34,680 --> 00:50:37,319 now and we have now a template which is 1099 00:50:37,319 --> 00:50:39,660 called the demo view go into my app View 1100 00:50:39,660 --> 00:50:42,900 and I'm going to say 1101 00:50:42,900 --> 00:50:46,500 if if I need to use this demo I need to 1102 00:50:46,500 --> 00:50:48,599 First import that component inside my 1103 00:50:48,599 --> 00:50:50,400 application in case you are from a C 1104 00:50:50,400 --> 00:50:52,859 sharp or a Java background this is like 1105 00:50:52,859 --> 00:50:56,220 uh importing the namespace or import 1106 00:50:56,220 --> 00:50:58,500 using the namespace in c-sharp or 1107 00:50:58,500 --> 00:51:00,900 importing the names trees and Java 1108 00:51:00,900 --> 00:51:03,839 something similar so here we are going 1109 00:51:03,839 --> 00:51:06,660 to import but in in script we are not 1110 00:51:06,660 --> 00:51:08,700 importing the namespace itself we are 1111 00:51:08,700 --> 00:51:10,800 importing the component itself the whole 1112 00:51:10,800 --> 00:51:14,400 component there are two ways like there 1113 00:51:14,400 --> 00:51:16,740 is called as a named export and the 1114 00:51:16,740 --> 00:51:19,079 normal exporter we will look into that 1115 00:51:19,079 --> 00:51:21,720 in a later stage but currently let's say 1116 00:51:21,720 --> 00:51:24,059 you can give any name you are importing 1117 00:51:24,059 --> 00:51:28,440 something and I will give it as JJJ 1118 00:51:28,440 --> 00:51:29,640 from 1119 00:51:29,640 --> 00:51:32,300 foreign 1120 00:51:40,559 --> 00:51:43,980 I have imported something from the motor 1121 00:51:43,980 --> 00:51:47,520 View and I'm giving it a name called JJJ 1122 00:51:47,520 --> 00:51:50,700 and why did I give it as JJJ 1123 00:51:50,700 --> 00:51:52,619 thank you sense no 1124 00:51:52,619 --> 00:51:56,460 no but I want to show you that 1125 00:51:56,460 --> 00:51:58,680 it doesn't matter what your name 1126 00:51:58,680 --> 00:52:00,960 unless you are using named exports you 1127 00:52:00,960 --> 00:52:02,760 can give any name you want and you come 1128 00:52:02,760 --> 00:52:03,619 inside 1129 00:52:03,619 --> 00:52:07,260 now what is a named exporter 1130 00:52:07,260 --> 00:52:11,000 do we have named exports here 1131 00:52:12,240 --> 00:52:13,559 nope 1132 00:52:13,559 --> 00:52:16,099 here 1133 00:52:17,599 --> 00:52:20,940 nope okay we were looking to the named 1134 00:52:20,940 --> 00:52:22,859 exports at a later stage anyhow but 1135 00:52:22,859 --> 00:52:25,020 currently we know that we have placed 1136 00:52:25,020 --> 00:52:27,079 something inside this 1137 00:52:27,079 --> 00:52:29,280 demo and we are importing the demo 1138 00:52:29,280 --> 00:52:30,599 inside 1139 00:52:30,599 --> 00:52:33,240 so since this JDJ is just to show you 1140 00:52:33,240 --> 00:52:34,740 that you can name anything you want but 1141 00:52:34,740 --> 00:52:38,099 I will I'll make it a reasonable one I'm 1142 00:52:38,099 --> 00:52:39,480 importing 1143 00:52:39,480 --> 00:52:41,700 demo 1144 00:52:41,700 --> 00:52:44,400 come from demo.io 1145 00:52:44,400 --> 00:52:47,099 there is no nowhere I have specified 1146 00:52:47,099 --> 00:52:49,859 that whatever I import from it should be 1147 00:52:49,859 --> 00:52:52,380 named as demo now that's not a named 1148 00:52:52,380 --> 00:52:55,260 export it's a normal one so I have it 1149 00:52:55,260 --> 00:52:58,380 here let me go back to My Demo View so 1150 00:52:58,380 --> 00:53:01,020 you have now set up a separate component 1151 00:53:01,020 --> 00:53:02,700 and you are importing the component 1152 00:53:02,700 --> 00:53:04,800 inside another component so this is a 1153 00:53:04,800 --> 00:53:06,960 way how we can do it now we want to 1154 00:53:06,960 --> 00:53:10,740 reuse it press Ctrl space Sorry alt 1155 00:53:10,740 --> 00:53:13,140 shift down arrow in I'm using Windows 1156 00:53:13,140 --> 00:53:16,440 10. so now there will be two 1157 00:53:16,440 --> 00:53:18,720 now that will be true you want to adjust 1158 00:53:18,720 --> 00:53:21,980 the way how it looks 1159 00:53:25,020 --> 00:53:27,480 go to your demo and in one place you 1160 00:53:27,480 --> 00:53:29,880 adjust it and everywhere it will be 1161 00:53:29,880 --> 00:53:33,119 uh effect error moments ago while we 1162 00:53:33,119 --> 00:53:35,000 were discussing about uh 1163 00:53:35,000 --> 00:53:38,460 CSS I said there are three ways how you 1164 00:53:38,460 --> 00:53:40,559 can access your elements one is directly 1165 00:53:40,559 --> 00:53:44,640 calling the element right like image 1166 00:53:44,640 --> 00:53:47,819 and then put this one and call it the 1167 00:53:47,819 --> 00:53:50,040 other two ways are through ID through 1168 00:53:50,040 --> 00:53:52,440 class so first let me show something 1169 00:53:52,440 --> 00:53:55,319 write this 1170 00:53:55,319 --> 00:53:57,920 100 pixel 1171 00:53:57,920 --> 00:54:01,940 uh how it's spelling mistake 1172 00:54:03,960 --> 00:54:06,599 so height is now 100 pixels for both the 1173 00:54:06,599 --> 00:54:08,940 elements both the components where I 1174 00:54:08,940 --> 00:54:11,579 have imported the height is now modified 1175 00:54:11,579 --> 00:54:15,000 now it's okay I say that image is like 1176 00:54:15,000 --> 00:54:16,859 I'm directly affecting the image so in 1177 00:54:16,859 --> 00:54:18,420 case I have one more image with a 1178 00:54:18,420 --> 00:54:21,440 different uh uh 1179 00:54:21,440 --> 00:54:24,839 different uh source for instance let's 1180 00:54:24,839 --> 00:54:28,520 say I use 1181 00:54:28,800 --> 00:54:31,440 view dot SVG 1182 00:54:31,440 --> 00:54:34,920 even that becomes hundred 1183 00:54:34,920 --> 00:54:37,740 no I don't need it I want a dragon 1184 00:54:37,740 --> 00:54:39,420 should be at a different height and this 1185 00:54:39,420 --> 00:54:40,800 should be at a different way then in 1186 00:54:40,800 --> 00:54:42,420 that case we have something called ID 1187 00:54:42,420 --> 00:54:46,020 you give this is Dragon image 1188 00:54:46,020 --> 00:54:48,780 and I give an ID 1189 00:54:48,780 --> 00:54:52,619 call it as a view image how do I access 1190 00:54:52,619 --> 00:54:55,859 my IDs you can directly access your 1191 00:54:55,859 --> 00:54:58,500 elements using HTML elements using like 1192 00:54:58,500 --> 00:55:00,079 a um 1193 00:55:00,079 --> 00:55:02,940 for anything that is related 1194 00:55:02,940 --> 00:55:04,520 hash 1195 00:55:04,520 --> 00:55:07,440 dragon vmg 1196 00:55:07,440 --> 00:55:09,720 and say 1197 00:55:09,720 --> 00:55:13,200 hide this 50 pixel 1198 00:55:13,200 --> 00:55:15,859 save it 1199 00:55:16,619 --> 00:55:19,319 what happened you are already having the 1200 00:55:19,319 --> 00:55:22,680 image you are setting the height then 1201 00:55:22,680 --> 00:55:25,020 again you are calling that Dragon image 1202 00:55:25,020 --> 00:55:27,839 and say the height is 50. now let me cut 1203 00:55:27,839 --> 00:55:28,980 this 1204 00:55:28,980 --> 00:55:31,800 and uh okay let us not confuse that 1205 00:55:31,800 --> 00:55:34,319 press enter I will change this class ID 1206 00:55:34,319 --> 00:55:36,240 to class 1207 00:55:36,240 --> 00:55:39,900 and I will change this ID to class save 1208 00:55:39,900 --> 00:55:43,640 it it will not work 1209 00:55:49,440 --> 00:55:51,059 yeah 1210 00:55:51,059 --> 00:55:54,079 let's refresh 1211 00:55:54,660 --> 00:55:56,700 the reason is 1212 00:55:56,700 --> 00:56:00,720 when you put hash that is for ID of the 1213 00:56:00,720 --> 00:56:03,599 elements for classes you need to put 1214 00:56:03,599 --> 00:56:06,000 data 1215 00:56:06,000 --> 00:56:08,579 only the places where you have data that 1216 00:56:08,579 --> 00:56:11,119 will affect it 1217 00:56:11,220 --> 00:56:13,980 so what I'm going to do 1218 00:56:13,980 --> 00:56:18,119 for a dragon I have a class and here I 1219 00:56:18,119 --> 00:56:19,680 have an idle 1220 00:56:19,680 --> 00:56:23,839 for ID as I said we need to have 1221 00:56:23,880 --> 00:56:25,260 hash 1222 00:56:25,260 --> 00:56:27,440 and height will be 1223 00:56:27,440 --> 00:56:31,319 250 pixel so I repeat again to access an 1224 00:56:31,319 --> 00:56:34,020 ID you put a hash symbol for accessing 1225 00:56:34,020 --> 00:56:36,480 the class we put dot symbol and to 1226 00:56:36,480 --> 00:56:38,460 access the element itself no symbol 1227 00:56:38,460 --> 00:56:40,140 directly call the name and press save 1228 00:56:40,140 --> 00:56:42,720 there we go 1229 00:56:42,720 --> 00:56:47,420 so 50 50 250. 1230 00:56:48,839 --> 00:56:51,000 I'm going to show something I have 1231 00:56:51,000 --> 00:56:53,579 commented about this Dragon but before 1232 00:56:53,579 --> 00:56:57,780 we proceed I'm going to open up my 1233 00:56:57,780 --> 00:57:01,079 uh browser I use 1234 00:57:01,079 --> 00:57:04,760 Firefox I have uh which is 1235 00:57:04,760 --> 00:57:06,900 devtools installed and you need to do 1236 00:57:06,900 --> 00:57:08,700 that you need to go to extension so 1237 00:57:08,700 --> 00:57:10,740 search for add-on 1238 00:57:10,740 --> 00:57:12,960 this is the same for both Firefox and 1239 00:57:12,960 --> 00:57:15,480 chrome and Firefox I could get view 1240 00:57:15,480 --> 00:57:17,880 review.js type tools I have installed it 1241 00:57:17,880 --> 00:57:19,800 then I will be seeing it here whenever 1242 00:57:19,800 --> 00:57:24,359 I'm dealing with any UJS website that 1243 00:57:24,359 --> 00:57:26,339 will show up for me 1244 00:57:26,339 --> 00:57:29,540 um you can do the same for 1245 00:57:29,950 --> 00:57:31,500 [Music] 1246 00:57:31,500 --> 00:57:34,520 Chrome as well 1247 00:57:35,819 --> 00:57:38,700 I'm quickly going to add one more 1248 00:57:38,700 --> 00:57:41,280 element now what I'm going to show now 1249 00:57:41,280 --> 00:57:43,140 is I'm going to show how the Precedence 1250 00:57:43,140 --> 00:57:44,579 works 1251 00:57:44,579 --> 00:57:48,480 hello world save it and let's let's run 1252 00:57:48,480 --> 00:57:50,339 our application it's already running in 1253 00:57:50,339 --> 00:57:52,920 a location 1254 00:57:52,920 --> 00:57:56,339 okay hello world is there let's go back 1255 00:57:56,339 --> 00:57:58,559 to our app View and remove one component 1256 00:57:58,559 --> 00:58:01,440 okay save it should have only one now 1257 00:58:01,440 --> 00:58:04,559 that we know uh two things uh one is uh 1258 00:58:04,559 --> 00:58:07,020 we can access the priorities we know 1259 00:58:07,020 --> 00:58:10,800 like you know the priority of 1260 00:58:10,800 --> 00:58:13,859 the element the class the ID but we 1261 00:58:13,859 --> 00:58:15,420 don't know the Precedence order of 1262 00:58:15,420 --> 00:58:17,400 Precedence which gets the priority what 1263 00:58:17,400 --> 00:58:19,559 if I have all three 1264 00:58:19,559 --> 00:58:21,359 that's two and then I have a class 1265 00:58:21,359 --> 00:58:22,430 called uh 1266 00:58:22,430 --> 00:58:24,300 [Music] 1267 00:58:24,300 --> 00:58:27,000 texture class and then I have a ID 1268 00:58:27,000 --> 00:58:28,260 called 1269 00:58:28,260 --> 00:58:31,619 text ID then I give all the words here 1270 00:58:31,619 --> 00:58:33,920 let's do like a 1271 00:58:33,920 --> 00:58:37,640 texture CLS 1272 00:58:43,380 --> 00:58:48,540 Indian red and font sizes 1273 00:58:48,540 --> 00:58:50,819 3M 1274 00:58:50,819 --> 00:58:53,400 save font size needs to have an iPhone 1275 00:58:53,400 --> 00:58:55,880 in between 1276 00:58:58,980 --> 00:59:02,240 or maybe forum 1277 00:59:02,640 --> 00:59:07,819 okay and I will do a hash IDs text ID 1278 00:59:07,819 --> 00:59:12,599 when I say color is pale green 1279 00:59:12,599 --> 00:59:16,920 and font size is 1280 00:59:16,920 --> 00:59:20,720 2m say 1281 00:59:20,940 --> 00:59:23,700 okay and then finally 1282 00:59:23,700 --> 00:59:26,099 H2 itself 1283 00:59:26,099 --> 00:59:29,700 the element itself then I copy this 1284 00:59:29,700 --> 00:59:32,900 let's change to 1285 00:59:34,319 --> 00:59:36,000 1am 1286 00:59:36,000 --> 00:59:38,280 and color is 1287 00:59:38,280 --> 00:59:39,900 yellow 1288 00:59:39,900 --> 00:59:43,319 now which takes that most recent answer 1289 00:59:43,319 --> 00:59:45,540 and let me open up a note right now 1290 00:59:45,540 --> 00:59:48,000 let's remove it here itself the way the 1291 00:59:48,000 --> 00:59:51,020 order of Precedence is 1292 00:59:51,619 --> 00:59:54,599 I'm not sure if the spelling is correct 1293 00:59:54,599 --> 00:59:56,880 order of precedences 1294 00:59:56,880 --> 00:59:58,319 one 1295 00:59:58,319 --> 01:00:00,540 HTML element 1296 01:00:00,540 --> 01:00:03,420 is it the order of persons no it's the 1297 01:00:03,420 --> 01:00:06,200 let's say 1298 01:00:06,720 --> 01:00:07,380 um 1299 01:00:07,380 --> 01:00:13,020 Target element gets utmost top priority 1300 01:00:13,020 --> 01:00:16,040 Target element 1301 01:00:20,280 --> 01:00:23,819 how to increase the size of this 1302 01:00:23,819 --> 01:00:26,420 View 1303 01:00:30,859 --> 01:00:34,339 zoom in this View 1304 01:00:34,559 --> 01:00:36,540 okay 1305 01:00:36,540 --> 01:00:39,240 Control Plus equal 1306 01:00:39,240 --> 01:00:41,280 Control Plus equal increases control 1307 01:00:41,280 --> 01:00:44,040 plus minus decreases let's put Control 1308 01:00:44,040 --> 01:00:47,660 Plus equal and increase this one 1309 01:00:47,660 --> 01:00:50,579 this whole one is different it looks I 1310 01:00:50,579 --> 01:00:52,020 don't want the left side I just only 1311 01:00:52,020 --> 01:00:54,180 want this one 1312 01:00:54,180 --> 01:00:56,819 okay I found out where it is so it's 1313 01:00:56,819 --> 01:00:59,579 present in uh when you press Ctrl equal 1314 01:00:59,579 --> 01:01:01,799 it increases the whole application which 1315 01:01:01,799 --> 01:01:04,740 is not that we need so let me press Ctrl 1316 01:01:04,740 --> 01:01:08,180 0 it resets everything 1317 01:01:08,280 --> 01:01:11,040 or control minus 2 minimize the control 1318 01:01:11,040 --> 01:01:13,520 equal 1319 01:01:14,339 --> 01:01:18,000 for an application this useful uh 1320 01:01:18,000 --> 01:01:20,040 this is stupid 1321 01:01:20,040 --> 01:01:22,740 ah okay so I was saying Ctrl shift to p 1322 01:01:22,740 --> 01:01:25,260 and I have something called Zoom call 1323 01:01:25,260 --> 01:01:27,599 editor font zoom in now 1324 01:01:27,599 --> 01:01:29,760 do they have shortcut key for this they 1325 01:01:29,760 --> 01:01:32,220 don't have a shortcut key 1326 01:01:32,220 --> 01:01:35,960 let's say decide the key is 1327 01:01:36,359 --> 01:01:39,240 Ctrl shift to five 1328 01:01:39,240 --> 01:01:41,460 nope 1329 01:01:41,460 --> 01:01:44,099 Ctrl shift 5. 1330 01:01:44,099 --> 01:01:46,500 if I press Ctrl shift to existing 1331 01:01:46,500 --> 01:01:48,180 commands as a spending why do you have 1332 01:01:48,180 --> 01:01:51,200 control alt 1333 01:01:51,200 --> 01:01:53,579 Ctrl alt five 1334 01:01:53,579 --> 01:01:55,859 ah no one has shift all the side okay 1335 01:01:55,859 --> 01:01:59,579 shift alt fine or maybe shift out 1336 01:01:59,579 --> 01:02:01,859 shift alt equal to no one has it okay 1337 01:02:01,859 --> 01:02:03,960 shift alt equal to 1338 01:02:03,960 --> 01:02:06,000 and uh 1339 01:02:06,000 --> 01:02:08,819 shift Ctrl p 1340 01:02:08,819 --> 01:02:13,220 Zoom editor Zoom 1341 01:02:15,540 --> 01:02:18,500 did I miss something 1342 01:02:31,920 --> 01:02:36,059 uh editor font Zoom for zoom out and 1343 01:02:36,059 --> 01:02:37,079 reset 1344 01:02:37,079 --> 01:02:41,099 let me check this let's zoom out I will 1345 01:02:41,099 --> 01:02:43,200 say shift control 1346 01:02:43,200 --> 01:02:45,000 minus 1347 01:02:45,000 --> 01:02:47,160 good 1348 01:02:47,160 --> 01:02:50,280 but it's not a shift control minus 1349 01:02:50,280 --> 01:02:52,940 okay 1350 01:02:57,380 --> 01:03:00,619 seriously guys 1351 01:03:05,640 --> 01:03:08,760 zoom in zoom out is there if I reset I 1352 01:03:08,760 --> 01:03:11,400 will set uh 1353 01:03:11,400 --> 01:03:14,460 shift alt zero ah someone is already 1354 01:03:14,460 --> 01:03:16,920 using wire using that 1355 01:03:16,920 --> 01:03:20,119 shift Alt 1356 01:03:21,420 --> 01:03:25,799 shift alt 9 seriously 1357 01:03:26,339 --> 01:03:29,180 shift Alt 1358 01:03:29,180 --> 01:03:32,700 come on shift alt backspace perfect 1359 01:03:32,700 --> 01:03:34,319 enter 1360 01:03:34,319 --> 01:03:39,559 close it now let's try shift alt equals 1361 01:03:40,400 --> 01:03:43,500 that's good so shift all the equal and 1362 01:03:43,500 --> 01:03:44,220 increase 1363 01:03:44,220 --> 01:03:46,500 so that's fine 1364 01:03:46,500 --> 01:03:48,900 and gold wrap also should be there 1365 01:03:48,900 --> 01:03:52,680 water okay but why am I in the screen I 1366 01:03:52,680 --> 01:03:55,280 should not be here 1367 01:03:56,480 --> 01:03:59,760 okay the order of priority is the target 1368 01:03:59,760 --> 01:04:03,240 element inline CSS 1369 01:04:03,240 --> 01:04:05,280 gets top priority 1370 01:04:05,280 --> 01:04:07,740 then 1371 01:04:07,740 --> 01:04:10,760 element ID 1372 01:04:12,240 --> 01:04:14,599 then 1373 01:04:14,599 --> 01:04:18,020 element class 1374 01:04:18,020 --> 01:04:21,660 then element 1375 01:04:21,660 --> 01:04:23,040 tag 1376 01:04:23,040 --> 01:04:24,780 I don't know should I be calling it as 1377 01:04:24,780 --> 01:04:26,940 tag 1378 01:04:26,940 --> 01:04:29,460 HTML 1379 01:04:29,460 --> 01:04:33,299 element identifier 1380 01:04:33,299 --> 01:04:35,460 why do we need to confuse this 1381 01:04:35,460 --> 01:04:37,700 HTML 1382 01:04:37,700 --> 01:04:41,660 identifies what is to do 1383 01:04:42,720 --> 01:04:45,359 whatever 1384 01:04:45,359 --> 01:04:48,059 let me select our control backslash so 1385 01:04:48,059 --> 01:04:50,940 that it becomes commented out now let's 1386 01:04:50,940 --> 01:04:53,420 go up 1387 01:04:54,119 --> 01:04:55,260 okay 1388 01:04:55,260 --> 01:04:57,960 so as I have said that we will see from 1389 01:04:57,960 --> 01:05:01,799 topmost item so you have H2 you have a 1390 01:05:01,799 --> 01:05:05,940 class you have ID but the C even ID is 1391 01:05:05,940 --> 01:05:07,980 present it is taking the ID because it 1392 01:05:07,980 --> 01:05:10,799 is again the most uh order of 1393 01:05:10,799 --> 01:05:13,020 pressurizer so that's pale green if I 1394 01:05:13,020 --> 01:05:14,240 change it to 1395 01:05:14,240 --> 01:05:18,859 pink and save it should take think 1396 01:05:18,859 --> 01:05:21,599 and now if this is not present what will 1397 01:05:21,599 --> 01:05:23,339 be the next order it will take the 1398 01:05:23,339 --> 01:05:25,260 element class save 1399 01:05:25,260 --> 01:05:27,480 classes in the Android 1400 01:05:27,480 --> 01:05:30,799 if I remove this 1401 01:05:31,160 --> 01:05:34,559 class and text to both are like yeah 1402 01:05:34,559 --> 01:05:36,540 class and text to both 1403 01:05:36,540 --> 01:05:38,940 it will fall into yellow size 1404 01:05:38,940 --> 01:05:40,559 very small 1405 01:05:40,559 --> 01:05:43,020 so there we go and the topmost priority 1406 01:05:43,020 --> 01:05:45,119 is always inline CSS because you are 1407 01:05:45,119 --> 01:05:46,740 saying that this element directly has 1408 01:05:46,740 --> 01:05:50,480 this value Style 1409 01:05:50,520 --> 01:05:52,340 font sizes 1410 01:05:52,340 --> 01:05:53,940 [Music] 1411 01:05:53,940 --> 01:05:58,859 Forum like 3M and 1412 01:05:58,859 --> 01:06:04,920 color is purple save there we go 1413 01:06:04,920 --> 01:06:08,040 so this is the order of distance for uh 1414 01:06:08,040 --> 01:06:10,819 CSS 1415 01:06:11,460 --> 01:06:13,559 the next step is we have the hello world 1416 01:06:13,559 --> 01:06:14,520 here 1417 01:06:14,520 --> 01:06:17,940 but what if we want to see or give some 1418 01:06:17,940 --> 01:06:20,339 messages like this like instead of the 1419 01:06:20,339 --> 01:06:22,260 value directly we need to be able to 1420 01:06:22,260 --> 01:06:24,299 pass the message or the value for my 1421 01:06:24,299 --> 01:06:27,780 parent component to do that let's go 1422 01:06:27,780 --> 01:06:31,760 inside the demo part 1423 01:06:33,539 --> 01:06:35,940 the moment I use the key setup that 1424 01:06:35,940 --> 01:06:38,420 becomes 1425 01:06:38,640 --> 01:06:41,000 sorry 1426 01:06:42,359 --> 01:06:45,140 let's try 1427 01:06:47,480 --> 01:06:51,299 okay the moment I use the letter uh the 1428 01:06:51,299 --> 01:06:55,740 the key script it becomes a composition 1429 01:06:55,740 --> 01:06:57,260 API object 1430 01:06:57,260 --> 01:06:59,220 and so 1431 01:06:59,220 --> 01:07:02,339 we can do one thing we also need to set 1432 01:07:02,339 --> 01:07:06,079 up the language which is TSS 1433 01:07:06,720 --> 01:07:08,819 let me go here 1434 01:07:08,819 --> 01:07:11,819 okay what what is the what are the 1435 01:07:11,819 --> 01:07:13,799 things that we can expose from a script 1436 01:07:13,799 --> 01:07:16,440 we can expose a couple of things 1437 01:07:16,440 --> 01:07:19,500 one we can expose functions 1438 01:07:19,500 --> 01:07:22,920 and you can expose uh properties 1439 01:07:22,920 --> 01:07:27,000 to be filled from outside 1440 01:07:27,000 --> 01:07:31,760 and again how internal Properties or 1441 01:07:31,760 --> 01:07:33,619 attributes 1442 01:07:33,619 --> 01:07:37,200 like if you are from Java or C sharp 1443 01:07:37,200 --> 01:07:39,059 background you know that attributes 1444 01:07:39,059 --> 01:07:41,520 means some property or classes which are 1445 01:07:41,520 --> 01:07:43,500 accessible it's like the field which is 1446 01:07:43,500 --> 01:07:45,440 accessible only within the application 1447 01:07:45,440 --> 01:07:48,240 properties are 1448 01:07:48,240 --> 01:07:50,099 items which are 1449 01:07:50,099 --> 01:07:54,059 accessible from external values or 1450 01:07:54,059 --> 01:07:56,780 external methods 1451 01:07:56,940 --> 01:08:00,420 and then you can expose let's just only 1452 01:08:00,420 --> 01:08:02,220 focus on these three things 1453 01:08:02,220 --> 01:08:04,920 first and foremost you know for a proper 1454 01:08:04,920 --> 01:08:07,619 T value should be filled from outside 1455 01:08:07,619 --> 01:08:10,740 you need to define the props 1456 01:08:10,740 --> 01:08:12,720 just take a look at the script there is 1457 01:08:12,720 --> 01:08:16,400 no script the moment I press this 1458 01:08:21,060 --> 01:08:23,719 oops 1459 01:08:35,279 --> 01:08:37,679 you know what I thought there is going 1460 01:08:37,679 --> 01:08:39,920 to be something kind of 1461 01:08:39,920 --> 01:08:42,479 intelligence or slippers which will 1462 01:08:42,479 --> 01:08:44,759 directly do this for me looks like there 1463 01:08:44,759 --> 01:08:46,080 is nothing now 1464 01:08:46,080 --> 01:08:49,580 so that is all right so 1465 01:08:49,620 --> 01:08:52,198 Define props 1466 01:08:52,198 --> 01:08:55,339 when I put it inside 1467 01:08:55,339 --> 01:08:57,540 what is this 1468 01:08:57,540 --> 01:08:58,920 brackets 1469 01:08:58,920 --> 01:09:00,359 close it out 1470 01:09:00,359 --> 01:09:02,520 that's it let me save it and what does 1471 01:09:02,520 --> 01:09:05,399 it say it shows summative uh 1472 01:09:05,399 --> 01:09:08,339 it just gives me how I need to save it 1473 01:09:08,339 --> 01:09:10,799 like whenever I'm defining the props I 1474 01:09:10,799 --> 01:09:12,540 need to give the property name and Then 1475 01:09:12,540 --> 01:09:15,420 followed by what type of property it is 1476 01:09:15,420 --> 01:09:19,080 let us keep it simple now let's say I 1477 01:09:19,080 --> 01:09:21,779 have a property currently I don't but 1478 01:09:21,779 --> 01:09:23,460 let's assume that I have a property 1479 01:09:23,460 --> 01:09:25,500 called message and this will take up 1480 01:09:25,500 --> 01:09:27,120 only strings 1481 01:09:27,120 --> 01:09:29,900 that's it 1482 01:09:32,939 --> 01:09:36,439 you need to put it inside a 1483 01:09:36,738 --> 01:09:41,059 what is this called Curly basis 1484 01:09:43,979 --> 01:09:48,899 okay and yes this is not 1485 01:09:48,899 --> 01:09:52,039 it's a string 1486 01:09:54,120 --> 01:09:56,699 okay so what I'm saying let me save it 1487 01:09:56,699 --> 01:09:59,239 what I'm saying here is 1488 01:09:59,239 --> 01:10:02,699 and this particular demo component 1489 01:10:02,699 --> 01:10:04,920 the huberty it's an exposed property 1490 01:10:04,920 --> 01:10:07,199 when I say Define props this is a 1491 01:10:07,199 --> 01:10:08,940 property which can be accessed from 1492 01:10:08,940 --> 01:10:11,580 outside the world outside this component 1493 01:10:11,580 --> 01:10:14,400 there is a property called MSG which is 1494 01:10:14,400 --> 01:10:16,679 accessible from outside and this is a 1495 01:10:16,679 --> 01:10:18,420 kind of a string property that's what 1496 01:10:18,420 --> 01:10:21,000 I'm saying so the moment I go to this 1497 01:10:21,000 --> 01:10:23,400 app now when I press something in the 1498 01:10:23,400 --> 01:10:26,219 message now this is the receiver how do 1499 01:10:26,219 --> 01:10:28,380 I know that this is received so all I 1500 01:10:28,380 --> 01:10:31,340 can do is I can directly 1501 01:10:31,340 --> 01:10:33,480 whenever a component is loaded 1502 01:10:33,480 --> 01:10:35,340 everything inside the script will be 1503 01:10:35,340 --> 01:10:37,679 first and run now so which means that 1504 01:10:37,679 --> 01:10:40,140 whatever you put here any script that 1505 01:10:40,140 --> 01:10:41,820 will be loaded when this when this 1506 01:10:41,820 --> 01:10:44,040 object itself is created there are 1507 01:10:44,040 --> 01:10:46,679 several life cycle hooks like what to do 1508 01:10:46,679 --> 01:10:49,320 when it is mounted created or destroyed 1509 01:10:49,320 --> 01:10:51,540 whatever you want but currently let us 1510 01:10:51,540 --> 01:10:55,679 just do console.logger I need to log the 1511 01:10:55,679 --> 01:10:58,440 value message so like anyhow I'm 1512 01:10:58,440 --> 01:11:00,900 entering the value here but how do I 1513 01:11:00,900 --> 01:11:02,640 know that the value is received at this 1514 01:11:02,640 --> 01:11:05,640 point or not to do that I can I cannot 1515 01:11:05,640 --> 01:11:08,400 directly use MSG because this is an 1516 01:11:08,400 --> 01:11:10,860 exposed property or an external property 1517 01:11:10,860 --> 01:11:13,020 like this to be filled from outside I 1518 01:11:13,020 --> 01:11:15,060 can call it as a you know for namesake 1519 01:11:15,060 --> 01:11:18,000 it is an external property 1520 01:11:18,000 --> 01:11:20,280 or like expositive property 1521 01:11:20,280 --> 01:11:23,520 post are exporter whatever it is this 1522 01:11:23,520 --> 01:11:26,460 property will be filled from outside to 1523 01:11:26,460 --> 01:11:28,640 access this property from inside 1524 01:11:28,640 --> 01:11:31,020 you will not be directly able to call 1525 01:11:31,020 --> 01:11:33,120 message that will not work even if you 1526 01:11:33,120 --> 01:11:36,000 try it would fail let's see here 1527 01:11:36,000 --> 01:11:38,880 yeah you don't see that but if you press 1528 01:11:38,880 --> 01:11:41,159 F2 you see that message is not defined 1529 01:11:41,159 --> 01:11:42,360 which means the message is not 1530 01:11:42,360 --> 01:11:45,000 accessible then how do you access if you 1531 01:11:45,000 --> 01:11:47,340 are using old options API you will be 1532 01:11:47,340 --> 01:11:49,860 trying for props dot MSG 1533 01:11:49,860 --> 01:11:51,840 let's save it 1534 01:11:51,840 --> 01:11:53,460 and refresh 1535 01:11:53,460 --> 01:11:55,860 again you are not able to 1536 01:11:55,860 --> 01:11:58,500 read that option because props itself is 1537 01:11:58,500 --> 01:12:01,739 not defined so what do you do 1538 01:12:01,739 --> 01:12:04,980 in composition API you need to put it 1539 01:12:04,980 --> 01:12:07,620 inside a constant and call it as any 1540 01:12:07,620 --> 01:12:09,739 name you want it we call 1541 01:12:09,739 --> 01:12:12,420 E prop Maybe 1542 01:12:12,420 --> 01:12:15,960 so I'm defining this as an e prop and E 1543 01:12:15,960 --> 01:12:19,040 prop has a message 1544 01:12:20,400 --> 01:12:24,960 and if you press save clean this refresh 1545 01:12:24,960 --> 01:12:27,000 there you go hello 1546 01:12:27,000 --> 01:12:30,780 so if I change the name now hello to 1547 01:12:30,780 --> 01:12:34,760 hello lingam save 1548 01:12:35,940 --> 01:12:39,480 updated so app.view is now of data and 1549 01:12:39,480 --> 01:12:41,159 obviously the hello income also got 1550 01:12:41,159 --> 01:12:43,080 updated we're seeing it here because we 1551 01:12:43,080 --> 01:12:44,219 are not using it 1552 01:12:44,219 --> 01:12:47,460 that is totally fine now e-propriate 1553 01:12:47,460 --> 01:12:50,719 message we know that this is there 1554 01:12:53,880 --> 01:12:56,520 to access this message internally like 1555 01:12:56,520 --> 01:12:58,320 the message which is filled from outside 1556 01:12:58,320 --> 01:13:00,600 if you need to access it whether it is 1557 01:13:00,600 --> 01:13:02,400 an exported property or an internal 1558 01:13:02,400 --> 01:13:04,320 property 1559 01:13:04,320 --> 01:13:06,000 there is only one way there is not one 1560 01:13:06,000 --> 01:13:08,400 way like there is one most favored way 1561 01:13:08,400 --> 01:13:10,440 and there are other different ways One 1562 01:13:10,440 --> 01:13:13,980 is using the mustache symbol 1563 01:13:13,980 --> 01:13:14,760 um 1564 01:13:14,760 --> 01:13:17,040 View 1565 01:13:17,040 --> 01:13:19,199 are like 1566 01:13:19,199 --> 01:13:22,640 streamer most types yeah of course 1567 01:13:22,640 --> 01:13:25,440 it looks you know like I don't know why 1568 01:13:25,440 --> 01:13:27,659 they gave it a stats number two opening 1569 01:13:27,659 --> 01:13:32,040 braces it's it feels so uh 1570 01:13:32,040 --> 01:13:35,880 It Feels So chauvinistic but still we 1571 01:13:35,880 --> 01:13:38,520 call it as much as symbol and I don't 1572 01:13:38,520 --> 01:13:41,940 want to use the term stats like let's 1573 01:13:41,940 --> 01:13:44,699 call it as double braces throughout the 1574 01:13:44,699 --> 01:13:47,159 video so uh we will use the double 1575 01:13:47,159 --> 01:13:49,920 braces uh somewhere here in the hello 1576 01:13:49,920 --> 01:13:51,900 world I will use double braces double 1577 01:13:51,900 --> 01:13:55,260 curly braces double curly braces and put 1578 01:13:55,260 --> 01:13:58,260 e chemistry 1579 01:13:58,260 --> 01:14:01,800 now I will close this shave I should 1580 01:14:01,800 --> 01:14:04,980 become not the same the same in the vs 1581 01:14:04,980 --> 01:14:07,980 I should be now able to see Hello lingam 1582 01:14:07,980 --> 01:14:10,560 so this is mustache number but we will 1583 01:14:10,560 --> 01:14:12,719 be I 1584 01:14:12,719 --> 01:14:15,420 rises even though it is very long so the 1585 01:14:15,420 --> 01:14:18,480 double curly braces with MSG and go back 1586 01:14:18,480 --> 01:14:24,440 to here hello hello save 1587 01:14:26,900 --> 01:14:30,300 this color is so disturbing me so go 1588 01:14:30,300 --> 01:14:33,420 back here and change the inline color 1589 01:14:33,420 --> 01:14:34,980 very easy 1590 01:14:34,980 --> 01:14:36,780 there is inline color let's change and 1591 01:14:36,780 --> 01:14:38,699 remove the inline Style 1592 01:14:38,699 --> 01:14:41,280 so now it falls into ID what is the ID 1593 01:14:41,280 --> 01:14:44,699 color is in pink let's make the ID color 1594 01:14:44,699 --> 01:14:46,980 as yellow 1595 01:14:46,980 --> 01:14:50,820 and this one is 1596 01:14:50,820 --> 01:14:53,719 PL three 1597 01:14:54,239 --> 01:14:57,300 in size let's make it 3M 1598 01:14:57,300 --> 01:14:59,760 sale 1599 01:14:59,760 --> 01:15:02,460 so hello world is there and if you go 1600 01:15:02,460 --> 01:15:04,920 back and say hello World 2 whatever the 1601 01:15:04,920 --> 01:15:06,780 value that I changed here will get 1602 01:15:06,780 --> 01:15:09,000 changed so instantly the moment I save 1603 01:15:09,000 --> 01:15:11,460 it in the code in production environment 1604 01:15:11,460 --> 01:15:12,780 when you are 1605 01:15:12,780 --> 01:15:15,179 manipulating the values with regards to 1606 01:15:15,179 --> 01:15:18,300 some API or some user input you will 1607 01:15:18,300 --> 01:15:21,179 still see them same like this oh going 1608 01:15:21,179 --> 01:15:24,719 back to My Demo component so now I have 1609 01:15:24,719 --> 01:15:26,820 managed to do one thing I added one 1610 01:15:26,820 --> 01:15:28,140 property value 1611 01:15:28,140 --> 01:15:30,719 what if now let's try and add one more 1612 01:15:30,719 --> 01:15:33,500 property and I'll say 1613 01:15:33,500 --> 01:15:37,320 subtitle and call it as again as string 1614 01:15:37,320 --> 01:15:41,100 or let's say h so we call it as a number 1615 01:15:41,100 --> 01:15:42,900 and 1616 01:15:42,900 --> 01:15:44,900 um 1617 01:15:45,420 --> 01:15:51,600 so if sleeping call it as Boolean 1618 01:15:51,600 --> 01:15:53,659 and one more 1619 01:15:53,659 --> 01:15:57,600 title again it's a string so I expose so 1620 01:15:57,600 --> 01:15:59,880 many properties now and all these 1621 01:15:59,880 --> 01:16:02,280 properties will be available here 1622 01:16:02,280 --> 01:16:05,659 for instance h 1623 01:16:05,699 --> 01:16:10,800 it's a number again so let's say 34 1624 01:16:10,800 --> 01:16:13,520 save 1625 01:16:13,940 --> 01:16:17,219 uh type string is not assignable to type 1626 01:16:17,219 --> 01:16:18,120 number 1627 01:16:18,120 --> 01:16:23,000 so it's a type of number so 34. 1628 01:16:25,199 --> 01:16:27,960 element is missing and the tag where it 1629 01:16:27,960 --> 01:16:30,000 is missing in demo component 1630 01:16:30,000 --> 01:16:32,820 why it is processing okay forget about 1631 01:16:32,820 --> 01:16:34,980 it let's just give it like this and we 1632 01:16:34,980 --> 01:16:36,260 will handle it later 1633 01:16:36,260 --> 01:16:39,360 go back to this demo and then I will 1634 01:16:39,360 --> 01:16:42,420 have a couple of other items or maybe 1635 01:16:42,420 --> 01:16:45,719 here itself I can have message followed 1636 01:16:45,719 --> 01:16:47,820 by space 1637 01:16:47,820 --> 01:16:49,860 here I will just say 1638 01:16:49,860 --> 01:16:52,280 version of the message I will see 1639 01:16:52,280 --> 01:16:55,380 one more tag 1640 01:16:55,380 --> 01:16:58,860 Ctrl shift alt down arrow and this one 1641 01:16:58,860 --> 01:17:02,570 will be my hatch 3 1642 01:17:02,570 --> 01:17:04,380 [Music] 1643 01:17:04,380 --> 01:17:07,679 I will say h 1644 01:17:07,679 --> 01:17:10,580 this message you will call it as name 1645 01:17:10,580 --> 01:17:13,560 go back to app and this is no more 1646 01:17:13,560 --> 01:17:15,300 message this is name 1647 01:17:15,300 --> 01:17:17,760 you go back to demo and we have named it 1648 01:17:17,760 --> 01:17:19,920 as name name 1649 01:17:19,920 --> 01:17:23,179 and name hsh 1650 01:17:23,179 --> 01:17:26,640 and followed by 1651 01:17:26,640 --> 01:17:30,320 one symbol followed by 1652 01:17:31,260 --> 01:17:34,440 sleeping is 1653 01:17:34,440 --> 01:17:38,159 double curly braces with is sleeping 1654 01:17:38,159 --> 01:17:41,159 save 1655 01:17:41,520 --> 01:17:45,440 age sleeping the name is 1656 01:17:45,440 --> 01:17:48,900 sleeping is there go back to my here 1657 01:17:48,900 --> 01:17:51,300 name is Hello World true but I'm not 1658 01:17:51,300 --> 01:17:54,600 seeing the allowable too is here the 1659 01:17:54,600 --> 01:17:56,400 demo is there 1660 01:17:56,400 --> 01:17:59,600 am I missing something 1661 01:17:59,880 --> 01:18:03,000 ah this is H2 and this is H3 let us 1662 01:18:03,000 --> 01:18:05,699 remove the classes 1663 01:18:05,699 --> 01:18:08,120 save 1664 01:18:10,199 --> 01:18:12,600 let's keep only the classes and remove 1665 01:18:12,600 --> 01:18:15,080 the ID 1666 01:18:18,120 --> 01:18:20,120 [Music] 1667 01:18:20,120 --> 01:18:24,360 perfect so far uh save all 1668 01:18:24,360 --> 01:18:29,280 and close this refresh okay so let's try 1669 01:18:29,280 --> 01:18:31,739 to change the hello world instead of 1670 01:18:31,739 --> 01:18:33,360 otherwise that's the name right I will 1671 01:18:33,360 --> 01:18:36,320 give my full name 1672 01:18:37,080 --> 01:18:39,620 save 1673 01:18:39,719 --> 01:18:42,540 that's my name but it's not looking nice 1674 01:18:42,540 --> 01:18:47,780 so I'll just keep Simple just saying 1675 01:18:48,360 --> 01:18:50,460 there you go 1676 01:18:50,460 --> 01:18:53,159 start from 30 1677 01:18:53,159 --> 01:18:55,980 and it's it's updated here 1678 01:18:55,980 --> 01:18:57,780 32 1679 01:18:57,780 --> 01:19:01,500 so 320 I wish 1680 01:19:01,500 --> 01:19:04,520 okay let's give that a call give example 1681 01:19:04,520 --> 01:19:08,179 is sleeping is false in case I say it's 1682 01:19:08,179 --> 01:19:12,860 sleeping it's true 1683 01:19:14,219 --> 01:19:16,040 so sleeping is true 1684 01:19:16,040 --> 01:19:18,719 instead of true or false I can go back 1685 01:19:18,719 --> 01:19:21,360 to My Demo here so what we have achieved 1686 01:19:21,360 --> 01:19:24,540 now we have exposed sum properties let's 1687 01:19:24,540 --> 01:19:26,340 remove title we are not using 1688 01:19:26,340 --> 01:19:30,239 it there are some errors that shows 1689 01:19:30,239 --> 01:19:32,100 that since we are using typescript it 1690 01:19:32,100 --> 01:19:34,440 says that this is uh you are passing in 1691 01:19:34,440 --> 01:19:36,719 a number string but it should be a 1692 01:19:36,719 --> 01:19:38,100 number but in case you are coming 1693 01:19:38,100 --> 01:19:40,020 getting this value now we are directly 1694 01:19:40,020 --> 01:19:41,699 passing in the value so it says like 1695 01:19:41,699 --> 01:19:43,920 this that if you're passing in the value 1696 01:19:43,920 --> 01:19:45,480 from the script you are fetching 1697 01:19:45,480 --> 01:19:47,159 somewhere you will directly convert this 1698 01:19:47,159 --> 01:19:50,219 element to uh number this one you will 1699 01:19:50,219 --> 01:19:51,900 convert it to a Boolean and then it will 1700 01:19:51,900 --> 01:19:54,000 pass it through so you can fix that 1701 01:19:54,000 --> 01:19:57,000 later but now this is fine going back to 1702 01:19:57,000 --> 01:19:58,140 the demo 1703 01:19:58,140 --> 01:20:00,300 so I now know like something the double 1704 01:20:00,300 --> 01:20:03,300 curly braces I will be able to 1705 01:20:03,300 --> 01:20:06,140 do does that mean that is 1706 01:20:06,140 --> 01:20:09,600 this is the only possibility now did you 1707 01:20:09,600 --> 01:20:11,280 notice something 1708 01:20:11,280 --> 01:20:13,860 I have given my property as the camel 1709 01:20:13,860 --> 01:20:15,780 case first letter is small and this 1710 01:20:15,780 --> 01:20:19,040 again word special letter is caps 1711 01:20:19,040 --> 01:20:21,600 uppercase not the lower case so it's a 1712 01:20:21,600 --> 01:20:24,060 lower Keys and this is uppercase but 1713 01:20:24,060 --> 01:20:27,000 here it is taken Kebab case which is is 1714 01:20:27,000 --> 01:20:30,000 sleeping which means that if you give 1715 01:20:30,000 --> 01:20:32,280 camel case it will still accept Kebab 1716 01:20:32,280 --> 01:20:35,520 case as well let's say if I give camel 1717 01:20:35,520 --> 01:20:38,460 case asses that is still valid if we put 1718 01:20:38,460 --> 01:20:40,380 false 1719 01:20:40,380 --> 01:20:45,239 for also so Kebab is camel case view has 1720 01:20:45,239 --> 01:20:48,000 this way of converting it so let's just 1721 01:20:48,000 --> 01:20:49,020 uh 1722 01:20:49,020 --> 01:20:52,080 appreciate it for this purpose 1723 01:20:52,080 --> 01:20:55,679 and uh going back you can not only put 1724 01:20:55,679 --> 01:20:59,400 uh the property in your uh 1725 01:20:59,400 --> 01:21:01,620 curly braces double curly braces you can 1726 01:21:01,620 --> 01:21:03,840 also give a method directory for 1727 01:21:03,840 --> 01:21:05,300 instance 1728 01:21:05,300 --> 01:21:08,460 you might have known uh from C sharp I 1729 01:21:08,460 --> 01:21:12,260 believe it is called as null coasterator 1730 01:21:17,000 --> 01:21:20,179 of course 1731 01:21:20,780 --> 01:21:24,679 sing operator on C sharp 1732 01:21:24,679 --> 01:21:30,080 uh it's an alcoholic no not this one no 1733 01:21:30,900 --> 01:21:32,460 this is for 1734 01:21:32,460 --> 01:21:33,300 um 1735 01:21:33,300 --> 01:21:37,400 checking if your values it is called uh 1736 01:21:37,400 --> 01:21:40,320 conditional term area ternary operation 1737 01:21:40,320 --> 01:21:42,500 yeah 1738 01:21:45,080 --> 01:21:47,640 if the condition is true you give 1739 01:21:47,640 --> 01:21:49,260 something and colon you give something 1740 01:21:49,260 --> 01:21:53,340 else this is same in Python Java C sharp 1741 01:21:53,340 --> 01:21:56,100 everywhere since we are dealing with uh 1742 01:21:56,100 --> 01:21:59,100 web we will go for JavaScript 1743 01:21:59,100 --> 01:22:01,320 uh this is something like this you give 1744 01:22:01,320 --> 01:22:04,020 a condition then you give the specific 1745 01:22:04,020 --> 01:22:07,380 value if true if also conditional 1746 01:22:07,380 --> 01:22:10,320 ternary operation so if it is if 1747 01:22:10,320 --> 01:22:14,880 sleeping just say yes if not sleeping 1748 01:22:14,880 --> 01:22:16,020 say 1749 01:22:16,020 --> 01:22:17,460 nope 1750 01:22:17,460 --> 01:22:20,820 now false means no because it's sleeping 1751 01:22:20,820 --> 01:22:23,540 is fall safe 1752 01:22:23,940 --> 01:22:25,080 yes 1753 01:22:25,080 --> 01:22:27,659 is sleeping yes did I give slim I'm 1754 01:22:27,659 --> 01:22:30,179 always sleeping that's okay if sleeping 1755 01:22:30,179 --> 01:22:31,800 is false 1756 01:22:31,800 --> 01:22:35,600 even though I have given false 1757 01:22:37,620 --> 01:22:39,480 let's say true 1758 01:22:39,480 --> 01:22:42,739 and see what happens 1759 01:22:45,120 --> 01:22:48,000 something is wrong let's go back to the 1760 01:22:48,000 --> 01:22:53,340 demo and it's sleeping is false 1761 01:22:53,880 --> 01:22:57,140 Boolean right this is bull ah okay 1762 01:22:57,140 --> 01:23:01,679 because uh even though this is Boolean 1763 01:23:01,679 --> 01:23:04,980 giving some value there which is uh 1764 01:23:04,980 --> 01:23:07,679 where is my appearance it is considering 1765 01:23:07,679 --> 01:23:10,380 it as any value is present so it is 1766 01:23:10,380 --> 01:23:11,880 the answer in case I remove it it will 1767 01:23:11,880 --> 01:23:14,060 be false 1768 01:23:14,760 --> 01:23:18,060 no so I put any value inside not only 1769 01:23:18,060 --> 01:23:20,460 true I put any value inside 1770 01:23:20,460 --> 01:23:23,460 that is considered as true 1771 01:23:23,460 --> 01:23:25,980 that's the reason why we need 1772 01:23:25,980 --> 01:23:30,120 the value to be assigned hmm 1773 01:23:30,120 --> 01:23:32,699 anyhow that's okay I will come back to 1774 01:23:32,699 --> 01:23:35,880 this later let me put sleeping is false 1775 01:23:35,880 --> 01:23:38,520 even though this is false uh my 1776 01:23:38,520 --> 01:23:41,880 typescript says that this is a string so 1777 01:23:41,880 --> 01:23:43,800 this is not defined so what obviously 1778 01:23:43,800 --> 01:23:45,540 happens is it takes the circle that's 1779 01:23:45,540 --> 01:23:48,320 okay totally fine 1780 01:23:51,960 --> 01:23:54,960 button 1781 01:23:55,560 --> 01:24:00,260 and see how it looks save 1782 01:24:00,260 --> 01:24:03,840 okay a small button is seen here you 1783 01:24:03,840 --> 01:24:06,060 might be wondering like how we took the 1784 01:24:06,060 --> 01:24:08,520 color and how the hover everything was 1785 01:24:08,520 --> 01:24:11,400 because it's coming from this style.cs 1786 01:24:11,400 --> 01:24:13,679 is the default one in case you want to 1787 01:24:13,679 --> 01:24:15,600 modify something you want to modify the 1788 01:24:15,600 --> 01:24:17,699 Border radius color whatever it is the 1789 01:24:17,699 --> 01:24:19,320 background color I don't need this let's 1790 01:24:19,320 --> 01:24:21,780 say green 1791 01:24:21,780 --> 01:24:25,140 glue and save it I will be seeing that 1792 01:24:25,140 --> 01:24:28,940 change here so it's up to you and 1793 01:24:28,940 --> 01:24:31,380 let's let's go 1794 01:24:31,380 --> 01:24:34,280 let's change this up 1795 01:24:34,560 --> 01:24:38,219 and go back to My Demo component button 1796 01:24:38,219 --> 01:24:41,719 and I will say 1797 01:24:41,960 --> 01:24:45,739 button will be called 1798 01:24:48,739 --> 01:24:52,280 each save 1799 01:24:52,800 --> 01:24:55,500 and foreground I don't like this color 1800 01:24:55,500 --> 01:24:58,620 itself so save all and go back to my 1801 01:24:58,620 --> 01:25:01,560 style and the button let it be the 1802 01:25:01,560 --> 01:25:04,199 previous value whatever it was before 1803 01:25:04,199 --> 01:25:07,760 uh some dark color 1804 01:25:08,040 --> 01:25:10,640 save 1805 01:25:12,300 --> 01:25:14,100 because it was much better than the 1806 01:25:14,100 --> 01:25:16,159 beginning 1807 01:25:17,159 --> 01:25:20,600 something like this as well 1808 01:25:20,880 --> 01:25:23,520 okay whatever let's go back to the demo 1809 01:25:23,520 --> 01:25:25,920 and we have that done and this will have 1810 01:25:25,920 --> 01:25:29,000 a lot of other functions as well right 1811 01:25:29,000 --> 01:25:32,400 click method on click method you can 1812 01:25:32,400 --> 01:25:34,380 bind it one click okay if this is 1813 01:25:34,380 --> 01:25:37,080 directly coming from there and uh you 1814 01:25:37,080 --> 01:25:41,040 can bind V on V this uh colon with on 1815 01:25:41,040 --> 01:25:43,320 click everything has the same meaning 1816 01:25:43,320 --> 01:25:46,500 like you can create a function here what 1817 01:25:46,500 --> 01:25:48,500 should happen when you 1818 01:25:48,500 --> 01:25:51,120 press the button I'm defining a function 1819 01:25:51,120 --> 01:25:54,060 this is saying like uh creating a method 1820 01:25:54,060 --> 01:25:56,280 in any other programming general purpose 1821 01:25:56,280 --> 01:25:58,860 language like C sharp or Java function 1822 01:25:58,860 --> 01:26:02,040 and I'm going to call increase h 1823 01:26:02,040 --> 01:26:05,760 and uh I will call it here something and 1824 01:26:05,760 --> 01:26:09,179 a present I will just say console.log 1825 01:26:09,179 --> 01:26:12,620 we are here 1826 01:26:12,960 --> 01:26:16,440 save it and go back to this what 1827 01:26:16,440 --> 01:26:17,699 happened 1828 01:26:17,699 --> 01:26:20,159 uh 1829 01:26:20,159 --> 01:26:24,179 unexpected token ah okay where is this 1830 01:26:24,179 --> 01:26:27,679 unexpected token that happened 1831 01:26:27,900 --> 01:26:32,120 the function should be with uh 1832 01:26:32,420 --> 01:26:37,199 to open and close brackets increase 1833 01:26:37,199 --> 01:26:39,060 h 1834 01:26:39,060 --> 01:26:41,719 ick 1835 01:26:42,980 --> 01:26:45,600 increase the use of which we come on 1836 01:26:45,600 --> 01:26:49,139 click increase it so I click 1837 01:26:49,139 --> 01:26:51,719 call this method increases let's keep it 1838 01:26:51,719 --> 01:26:53,699 simple like that delete everything 1839 01:26:53,699 --> 01:26:55,699 president 1840 01:26:55,699 --> 01:26:58,320 you see like there are six times this 1841 01:26:58,320 --> 01:26:59,699 button is first that's why it is 1842 01:26:59,699 --> 01:27:02,940 increasing to eight now it's increasing 1843 01:27:02,940 --> 01:27:05,699 to 8 10 times so which means that this 1844 01:27:05,699 --> 01:27:08,159 is working this is working and we are 1845 01:27:08,159 --> 01:27:10,020 now able to change our 1846 01:27:10,020 --> 01:27:12,659 you what if we need to change this age 1847 01:27:12,659 --> 01:27:15,020 itself shall we try 1848 01:27:15,020 --> 01:27:19,739 uh H is equal to h plus 1849 01:27:19,739 --> 01:27:21,860 1 will it work 1850 01:27:21,860 --> 01:27:25,199 currently we know for a fact that this H 1851 01:27:25,199 --> 01:27:27,000 cannot be accessed directly like this 1852 01:27:27,000 --> 01:27:31,159 you need to access from here 1853 01:27:31,500 --> 01:27:33,300 let's just try h 1854 01:27:33,300 --> 01:27:35,159 dot value 1855 01:27:35,159 --> 01:27:39,179 is equal to e v dot h Dot 1856 01:27:39,179 --> 01:27:43,639 it's showing so many errors are presents 1857 01:27:43,880 --> 01:27:46,920 uh that is okay we are only seeing 1858 01:27:46,920 --> 01:27:48,600 whether we are able to access it or not 1859 01:27:48,600 --> 01:27:51,080 save it 1860 01:27:51,360 --> 01:27:53,580 we are here and we are facing so many so 1861 01:27:53,580 --> 01:27:56,699 many errors can't assign the property 1862 01:27:56,699 --> 01:27:59,460 value on 35 not an object I'm going to 1863 01:27:59,460 --> 01:28:01,980 just keep the age there and instead of 1864 01:28:01,980 --> 01:28:05,639 increase age we will say increase salary 1865 01:28:05,639 --> 01:28:08,159 and 1866 01:28:08,159 --> 01:28:10,260 we will come back to the other one later 1867 01:28:10,260 --> 01:28:13,860 we'll create salary and we will have 1868 01:28:13,860 --> 01:28:16,100 foreign 1869 01:28:17,659 --> 01:28:22,080 here and this one let's see 1870 01:28:22,080 --> 01:28:24,840 salary is 1871 01:28:24,840 --> 01:28:27,420 dollar 1872 01:28:27,420 --> 01:28:29,520 salary 1873 01:28:29,520 --> 01:28:33,560 whatever we are going to do now 1874 01:28:34,679 --> 01:28:38,100 and take the salary instead of exposing 1875 01:28:38,100 --> 01:28:40,760 from outside I'm going to keep it here 1876 01:28:40,760 --> 01:28:45,020 insert salary is equal to 1877 01:28:45,020 --> 01:28:48,239 4500 let's just just you know like this 1878 01:28:48,239 --> 01:28:50,699 and uh 1879 01:28:50,699 --> 01:28:55,760 salary is equal to salary plus one 1880 01:28:57,480 --> 01:28:58,980 just see 1881 01:28:58,980 --> 01:29:00,900 this will not work on me anymore because 1882 01:29:00,900 --> 01:29:04,980 salary is a constant so let 1883 01:29:04,980 --> 01:29:09,480 salary currently currently Let It Be 1884 01:29:09,480 --> 01:29:11,460 instant 1885 01:29:11,460 --> 01:29:15,420 not a constant increase salary 1886 01:29:15,420 --> 01:29:17,639 invalid projects you know we are not 1887 01:29:17,639 --> 01:29:20,000 here we are here yeah 1888 01:29:20,000 --> 01:29:22,500 once we have done that 1889 01:29:22,500 --> 01:29:25,639 we need to show 1890 01:29:25,639 --> 01:29:29,880 this seller you need to log what 1891 01:29:29,880 --> 01:29:31,139 salary 1892 01:29:31,139 --> 01:29:33,480 what is the first salary and what is 1893 01:29:33,480 --> 01:29:35,719 increased something like this save 1894 01:29:35,719 --> 01:29:39,300 delete everything increase salary it was 1895 01:29:39,300 --> 01:29:40,980 four thousand five hundred of course the 1896 01:29:40,980 --> 01:29:43,820 JavaScript kicking in 1897 01:29:43,820 --> 01:29:47,159 let's remove the brackets here so it's a 1898 01:29:47,159 --> 01:29:48,840 number 1899 01:29:48,840 --> 01:29:52,280 oh very good 1900 01:29:55,320 --> 01:29:57,600 that you know the reason is it is 1901 01:29:57,600 --> 01:30:00,600 considering this 4500 string and this is 1902 01:30:00,600 --> 01:30:02,699 a string and that's the reason why when 1903 01:30:02,699 --> 01:30:06,500 we press that uh it was giving me a 1904 01:30:06,500 --> 01:30:10,080 uh what do we say before it was 1905 01:30:10,080 --> 01:30:12,120 concatenating them the easiest way would 1906 01:30:12,120 --> 01:30:15,000 be to put a plus symbol in front of 1907 01:30:15,000 --> 01:30:17,940 whatever you consider as a number 1908 01:30:17,940 --> 01:30:21,960 and add it with another 1909 01:30:21,960 --> 01:30:23,280 one 1910 01:30:23,280 --> 01:30:27,679 so now when we do this we are fresh 1911 01:30:28,260 --> 01:30:31,760 it's saying that is a mirror 1912 01:30:31,760 --> 01:30:35,540 what is the error 1913 01:30:36,600 --> 01:30:38,280 forget about it 1914 01:30:38,280 --> 01:30:40,820 uh 1915 01:30:40,820 --> 01:30:43,560 okay now it is increasing each time I 1916 01:30:43,560 --> 01:30:45,780 press it is increasing to thousand 1917 01:30:45,780 --> 01:30:47,880 thousand is getting increased 1918 01:30:47,880 --> 01:30:50,400 so it is writing the first one which is 1919 01:30:50,400 --> 01:30:53,239 we'll call it as 1920 01:30:53,699 --> 01:30:56,360 current 1921 01:30:56,520 --> 01:30:59,520 ah 1922 01:31:01,390 --> 01:31:04,579 [Music] 1923 01:31:08,159 --> 01:31:11,360 and here 1924 01:31:11,940 --> 01:31:15,260 on crystal 1925 01:31:18,120 --> 01:31:20,100 okay 1926 01:31:20,100 --> 01:31:21,840 let's check now 1927 01:31:21,840 --> 01:31:25,020 delete save save it refresh we don't 1928 01:31:25,020 --> 01:31:26,820 need to refresh at all but still I would 1929 01:31:26,820 --> 01:31:28,980 like to refresh current is fourth 1930 01:31:28,980 --> 01:31:32,040 wagonal increase with to 5500 1931 01:31:32,040 --> 01:31:34,800 now it is increasing okay so we know 1932 01:31:34,800 --> 01:31:36,719 that this method works so 1933 01:31:36,719 --> 01:31:40,380 but now this is not the only way that it 1934 01:31:40,380 --> 01:31:45,719 also have remove and say V on let's so 1935 01:31:45,719 --> 01:31:47,300 instead of that 1936 01:31:47,300 --> 01:31:50,940 symbol we are using V on click so it 1937 01:31:50,940 --> 01:31:54,659 gives the same uh uh value 1938 01:31:54,659 --> 01:31:56,580 you could see that it is changing from 1939 01:31:56,580 --> 01:32:00,139 13 500 14 500 1940 01:32:05,219 --> 01:32:07,280 . 1941 01:32:08,100 --> 01:32:10,320 each time I change the value is getting 1942 01:32:10,320 --> 01:32:12,480 changed but what happens to the salary 1943 01:32:12,480 --> 01:32:15,179 element itself it is not getting updated 1944 01:32:15,179 --> 01:32:18,300 only the value is getting changed but in 1945 01:32:18,300 --> 01:32:21,780 this uh binding is not working so it was 1946 01:32:21,780 --> 01:32:25,020 working in the first instance if you see 1947 01:32:25,020 --> 01:32:27,060 when it was when we changed to something 1948 01:32:27,060 --> 01:32:29,940 it was able to modify it it's not 1949 01:32:29,940 --> 01:32:32,400 accepting a presenter so what do we do 1950 01:32:32,400 --> 01:32:35,960 we need to somehow make this salary 1951 01:32:35,960 --> 01:32:39,480 reactive which means that this becomes a 1952 01:32:39,480 --> 01:32:42,540 reactive element or they should be 1953 01:32:42,540 --> 01:32:46,500 a trackable or you can think of whatever 1954 01:32:46,500 --> 01:32:48,659 term you want but somehow when the 1955 01:32:48,659 --> 01:32:51,960 change happens here uh view the elements 1956 01:32:51,960 --> 01:32:54,199 should be able to catch that to do that 1957 01:32:54,199 --> 01:32:58,139 we now go into the next one called as 1958 01:32:58,139 --> 01:33:01,679 import there is a keyword called ref in 1959 01:33:01,679 --> 01:33:04,020 composition API but I will directly type 1960 01:33:04,020 --> 01:33:07,280 ref and press tab so I got this 1961 01:33:07,280 --> 01:33:09,960 referendum reactivity I don't know if it 1962 01:33:09,960 --> 01:33:12,360 should come from more reactivity or 1963 01:33:12,360 --> 01:33:14,159 directly from 1964 01:33:14,159 --> 01:33:15,620 video 1965 01:33:15,620 --> 01:33:18,840 I will give it a view 1966 01:33:18,840 --> 01:33:20,940 what I do 1967 01:33:20,940 --> 01:33:23,639 I'm just going to wrap my initial value 1968 01:33:23,639 --> 01:33:26,280 with ref that's it I don't do anything 1969 01:33:26,280 --> 01:33:29,159 else but when I do something like this I 1970 01:33:29,159 --> 01:33:33,300 cannot have let I have const 1971 01:33:33,300 --> 01:33:37,560 okay we we already know that when we 1972 01:33:37,560 --> 01:33:39,179 change the value here we are doing it 1973 01:33:39,179 --> 01:33:41,340 but increase it's giving me current 1974 01:33:41,340 --> 01:33:43,139 object object and 1975 01:33:43,139 --> 01:33:46,020 of course it is called multiple times 1976 01:33:46,020 --> 01:33:49,520 probably uh 1977 01:33:49,560 --> 01:33:51,659 three times but still we are not seeing 1978 01:33:51,659 --> 01:33:54,360 the value that's because once you define 1979 01:33:54,360 --> 01:33:57,420 it as a const with the ref which means 1980 01:33:57,420 --> 01:33:59,100 that you are referring to an object 1981 01:33:59,100 --> 01:34:02,760 itself and this object has a value 1982 01:34:02,760 --> 01:34:05,040 don't put plus here then you are trying 1983 01:34:05,040 --> 01:34:07,860 to join this object with this object and 1984 01:34:07,860 --> 01:34:10,260 it is not able to identify just put a 1985 01:34:10,260 --> 01:34:11,699 comma 1986 01:34:11,699 --> 01:34:14,880 so you are anyhow the log is it is a 1987 01:34:14,880 --> 01:34:16,520 spreader operator which means that 1988 01:34:16,520 --> 01:34:18,960 whatever you give everything will be 1989 01:34:18,960 --> 01:34:19,560 like 1990 01:34:19,560 --> 01:34:22,219 first is a string and let's say you give 1991 01:34:22,219 --> 01:34:25,380 55 and then again you do a false 1992 01:34:25,380 --> 01:34:28,380 whatever you give with the comma it's a 1993 01:34:28,380 --> 01:34:30,300 spread the operator everything all the 1994 01:34:30,300 --> 01:34:32,460 array object will be logger something 1995 01:34:32,460 --> 01:34:33,900 like this 1996 01:34:33,900 --> 01:34:36,179 if I save this page 1997 01:34:36,179 --> 01:34:39,300 refresh and press this you could see 1998 01:34:39,300 --> 01:34:41,820 that 55 false so we need something like 1999 01:34:41,820 --> 01:34:44,580 this instead of that if I save salary 2000 01:34:44,580 --> 01:34:50,040 now and see this this should give me 2001 01:34:50,040 --> 01:34:53,060 I need to refresh the feature 2002 01:34:53,060 --> 01:34:56,520 the object itself so salary has now 2003 01:34:56,520 --> 01:34:59,639 become an object which is kind of a v 2004 01:34:59,639 --> 01:35:02,659 object something it is being 2005 01:35:02,880 --> 01:35:08,600 a vue.js so to get the value already 2006 01:35:09,120 --> 01:35:12,199 that's it there you go 2007 01:35:16,620 --> 01:35:19,020 okay so you are in three salaries now 2008 01:35:19,020 --> 01:35:21,840 here eight thousands now 2009 01:35:21,840 --> 01:35:24,780 what we need we need to increase the 2010 01:35:24,780 --> 01:35:26,460 variable 2011 01:35:26,460 --> 01:35:28,800 somehow it will not work because salary 2012 01:35:28,800 --> 01:35:30,659 is a constant and you will not be able 2013 01:35:30,659 --> 01:35:32,460 to change the constraint once it is 2014 01:35:32,460 --> 01:35:34,679 assigned so the only option as we 2015 01:35:34,679 --> 01:35:37,020 already know is instead of setting the 2016 01:35:37,020 --> 01:35:39,840 constant we set the value directly and 2017 01:35:39,840 --> 01:35:43,260 not like this we will get 2018 01:35:43,260 --> 01:35:45,260 uh let's say 2019 01:35:45,260 --> 01:35:48,600 salary you there are two ways how we can 2020 01:35:48,600 --> 01:35:50,900 do this but I will just directly use 2021 01:35:50,900 --> 01:35:54,239 salary dot value 2022 01:35:54,239 --> 01:35:56,060 Plus 2023 01:35:56,060 --> 01:35:59,340 let's say for every click I get those on 2024 01:35:59,340 --> 01:36:00,659 an agreement 2025 01:36:00,659 --> 01:36:03,480 and again we copy this 2026 01:36:03,480 --> 01:36:07,320 and paste it below and say updated 2027 01:36:07,320 --> 01:36:10,020 salary while you save this press 2028 01:36:10,020 --> 01:36:12,679 increment 2029 01:36:15,060 --> 01:36:17,880 for some reason 2030 01:36:17,880 --> 01:36:20,460 my function changes are not reflected 2031 01:36:20,460 --> 01:36:23,400 here let us refresh the screen 2032 01:36:23,400 --> 01:36:25,320 okay 2033 01:36:25,320 --> 01:36:27,780 but did you notice something not only 2034 01:36:27,780 --> 01:36:31,500 here even your HTML element value is 2035 01:36:31,500 --> 01:36:33,540 also getting updated so this is the 2036 01:36:33,540 --> 01:36:34,800 reactivity 2037 01:36:34,800 --> 01:36:36,900 earlier when we were having the let 2038 01:36:36,900 --> 01:36:39,060 value like lead salary something the 2039 01:36:39,060 --> 01:36:42,000 changes are only track uh here but it is 2040 01:36:42,000 --> 01:36:44,400 not updated in the UI but now the moment 2041 01:36:44,400 --> 01:36:47,340 you start using the ref keyword whenever 2042 01:36:47,340 --> 01:36:49,860 you change something it is also uh 2043 01:36:49,860 --> 01:36:51,120 updated 2044 01:36:51,120 --> 01:36:54,179 using the reactivity or how view Json 2045 01:36:54,179 --> 01:36:56,580 does it internally it will update it so 2046 01:36:56,580 --> 01:36:59,580 that's there we go uh so this is about 2047 01:36:59,580 --> 01:37:01,980 the ref keyword itself you can do this 2048 01:37:01,980 --> 01:37:04,560 and I was speaking of this functions you 2049 01:37:04,560 --> 01:37:07,139 don't even need a function 2050 01:37:07,139 --> 01:37:09,900 even uh copy this 2051 01:37:09,900 --> 01:37:12,659 and uh I'm just showing you how it will 2052 01:37:12,659 --> 01:37:15,260 be done just paste it here 2053 01:37:15,260 --> 01:37:19,280 inside the brackets 2054 01:37:19,739 --> 01:37:22,219 sorry 2055 01:37:23,460 --> 01:37:25,739 let's say double click places you place 2056 01:37:25,739 --> 01:37:26,760 it here 2057 01:37:26,760 --> 01:37:31,020 and uh you don't need salary here 2058 01:37:31,020 --> 01:37:33,360 save 2059 01:37:33,360 --> 01:37:35,880 it still works 2060 01:37:35,880 --> 01:37:37,920 here it is now updated that's what is 2061 01:37:37,920 --> 01:37:38,820 the screen 2062 01:37:38,820 --> 01:37:41,159 it still works but here you will not see 2063 01:37:41,159 --> 01:37:44,219 because the click is now not calling 2064 01:37:44,219 --> 01:37:46,380 this function this increase salary 2065 01:37:46,380 --> 01:37:48,300 function but in set directly you are 2066 01:37:48,300 --> 01:37:50,340 updating the value the thing is when you 2067 01:37:50,340 --> 01:37:54,540 are directly calling this property from 2068 01:37:54,540 --> 01:37:56,639 the HTML element you don't need to give 2069 01:37:56,639 --> 01:38:00,120 dot value because you are calling the 2070 01:38:00,120 --> 01:38:03,360 value directly but when you are doing it 2071 01:38:03,360 --> 01:38:05,820 from your function or in a script you 2072 01:38:05,820 --> 01:38:08,219 need to call it via the value 2073 01:38:08,219 --> 01:38:10,739 so let's go back to what it was before 2074 01:38:10,739 --> 01:38:14,159 the salary by this time not inside a 2075 01:38:14,159 --> 01:38:16,260 double curly basis I will just keep it 2076 01:38:16,260 --> 01:38:18,659 like this there we go and the first 2077 01:38:18,659 --> 01:38:20,960 system and here here 2078 01:38:20,960 --> 01:38:24,060 is okay 2079 01:38:24,060 --> 01:38:27,600 okay so this one so this is how uh we 2080 01:38:27,600 --> 01:38:30,060 can get value from my external object 2081 01:38:30,060 --> 01:38:34,620 like this uh put some value save it and 2082 01:38:34,620 --> 01:38:38,100 it gets updated I changed it to 38 and 2083 01:38:38,100 --> 01:38:42,560 38 is updated and if I go into demo then 2084 01:38:42,560 --> 01:38:45,360 the function to change the value track 2085 01:38:45,360 --> 01:38:47,219 and change the value internally using 2086 01:38:47,219 --> 01:38:49,679 the ref keyword this is all with the 2087 01:38:49,679 --> 01:38:53,460 composition API and for options API you 2088 01:38:53,460 --> 01:38:56,340 will have different the ways using the 2089 01:38:56,340 --> 01:39:00,139 data Expo data methods 2090 01:39:03,920 --> 01:39:08,280 and then we have one more thing which is 2091 01:39:08,280 --> 01:39:10,800 the life cycle itself what is our life 2092 01:39:10,800 --> 01:39:14,280 cycle you find to look into 2093 01:39:14,280 --> 01:39:18,780 our life cycle hooks view three it 2094 01:39:18,780 --> 01:39:20,000 should give me 2095 01:39:20,000 --> 01:39:24,719 ah here no not this is this a one ah 2096 01:39:24,719 --> 01:39:27,600 they have a map you can log it from 2097 01:39:27,600 --> 01:39:30,540 anywhere you want uh I will prefer going 2098 01:39:30,540 --> 01:39:32,420 to the 2099 01:39:32,420 --> 01:39:35,699 uh what is this one the official page 2100 01:39:35,699 --> 01:39:39,239 they have a nice chart here so what 2101 01:39:39,239 --> 01:39:41,820 happens is whenever an application is 2102 01:39:41,820 --> 01:39:43,080 set up 2103 01:39:43,080 --> 01:39:45,719 before create you have a method and 2104 01:39:45,719 --> 01:39:47,400 whatever you want to do before create 2105 01:39:47,400 --> 01:39:50,219 you can do that and after create then 2106 01:39:50,219 --> 01:39:52,199 before mounting before mounting is 2107 01:39:52,199 --> 01:39:54,120 basically when the application 2108 01:39:54,120 --> 01:39:56,760 loader into the Dom Elementor Dom 2109 01:39:56,760 --> 01:39:59,360 element is nothing but uh 2110 01:39:59,360 --> 01:40:01,920 uh I don't know full form of Dom 2111 01:40:01,920 --> 01:40:03,960 document object something but this is 2112 01:40:03,960 --> 01:40:06,600 the HTML node and after it is mounted 2113 01:40:06,600 --> 01:40:10,560 and before run mode and before 2114 01:40:10,560 --> 01:40:13,620 after unlocked basically after once it 2115 01:40:13,620 --> 01:40:15,900 is mounted then we don't have access to 2116 01:40:15,900 --> 01:40:17,580 all these things you have like before 2117 01:40:17,580 --> 01:40:20,760 update after data shall we see 2118 01:40:20,760 --> 01:40:22,980 um we will create all and then we will 2119 01:40:22,980 --> 01:40:25,280 see how it works 2120 01:40:25,280 --> 01:40:28,260 quickly for the life cycle 2121 01:40:28,260 --> 01:40:31,739 and now again we are in composite 2122 01:40:31,739 --> 01:40:33,360 purpose you need to import the life 2123 01:40:33,360 --> 01:40:34,460 cycle 2124 01:40:34,460 --> 01:40:37,560 methods from view if you directly try to 2125 01:40:37,560 --> 01:40:40,679 do it it will show up you here but it 2126 01:40:40,679 --> 01:40:42,840 will not work I will show an example of 2127 01:40:42,840 --> 01:40:46,739 our monitor uh on model is fine 2128 01:40:46,739 --> 01:40:49,739 what should I do on Mount that 2129 01:40:49,739 --> 01:40:51,739 um 2130 01:40:53,040 --> 01:40:55,380 you see it is immediately called from 2131 01:40:55,380 --> 01:40:57,600 inside if you don't have the keyword it 2132 01:40:57,600 --> 01:41:00,060 will obviously throw error and this is a 2133 01:41:00,060 --> 01:41:03,480 same like our defined props so you need 2134 01:41:03,480 --> 01:41:06,840 to call that and within the 2135 01:41:06,840 --> 01:41:09,179 curly this is Curly braces right within 2136 01:41:09,179 --> 01:41:10,860 the brackets you need to define the 2137 01:41:10,860 --> 01:41:13,139 function whatever you want to Define 2138 01:41:13,139 --> 01:41:16,199 like what should happen during the mount 2139 01:41:16,199 --> 01:41:20,520 or update the same concept so here 2140 01:41:20,520 --> 01:41:22,800 I will call this one 2141 01:41:22,800 --> 01:41:26,580 let's do so whatever is inside the 2142 01:41:26,580 --> 01:41:29,100 curly braces what does it say you cannot 2143 01:41:29,100 --> 01:41:32,520 find name one motor so of course so on 2144 01:41:32,520 --> 01:41:34,440 counter 2145 01:41:34,440 --> 01:41:37,080 now there it is and it has another error 2146 01:41:37,080 --> 01:41:40,560 what does it say uh ah okay so it is not 2147 01:41:40,560 --> 01:41:43,739 expecting uh curly braces it is 2148 01:41:43,739 --> 01:41:46,080 expecting a function now we can do it in 2149 01:41:46,080 --> 01:41:48,719 two ways uh we can either call a method 2150 01:41:48,719 --> 01:41:54,239 and say handle Mount and just give this 2151 01:41:54,239 --> 01:41:58,619 handle mode here this is one way like uh 2152 01:41:58,619 --> 01:42:02,400 you you can use a method and in case you 2153 01:42:02,400 --> 01:42:04,980 have a particular function which is 2154 01:42:04,980 --> 01:42:07,679 should be called a during runtime for 2155 01:42:07,679 --> 01:42:09,780 different ways like for unmounted for on 2156 01:42:09,780 --> 01:42:11,040 creator for everything you want 2157 01:42:11,040 --> 01:42:13,260 something you can call it like this or 2158 01:42:13,260 --> 01:42:15,900 you can directly use the uh Lambda 2159 01:42:15,900 --> 01:42:17,880 functions okay it is called as Lambda 2160 01:42:17,880 --> 01:42:21,000 and C sharp and here it is called as 2161 01:42:21,000 --> 01:42:24,119 Arrow function I can use Arrow function 2162 01:42:24,119 --> 01:42:25,920 let's just keep it simple now 2163 01:42:25,920 --> 01:42:27,980 console.log 2164 01:42:27,980 --> 01:42:31,500 uh I wanted 2165 01:42:31,500 --> 01:42:34,739 let's just save it and I'll just copy 2166 01:42:34,739 --> 01:42:37,320 this here because anywhere come on I 2167 01:42:37,320 --> 01:42:39,719 should have copied it 2168 01:42:39,719 --> 01:42:42,480 okay what happens now 2169 01:42:42,480 --> 01:42:44,400 I am saving it 2170 01:42:44,400 --> 01:42:46,619 uh we we saw this 2171 01:42:46,619 --> 01:42:48,600 um 2172 01:42:48,600 --> 01:42:49,830 what is that uh 2173 01:42:49,830 --> 01:42:51,960 [Music] 2174 01:42:51,960 --> 01:42:54,780 uh chart right a flowchart of some 2175 01:42:54,780 --> 01:42:58,560 vue.js website let's see it's not here 2176 01:42:58,560 --> 01:43:02,639 let me open up again separately 2177 01:43:02,639 --> 01:43:06,679 life cycle hooks 2178 01:43:08,159 --> 01:43:12,360 there we go so what does it say Mount is 2179 01:43:12,360 --> 01:43:14,940 before the object itself is mounted onto 2180 01:43:14,940 --> 01:43:17,520 your uh before Mount are unmounted like 2181 01:43:17,520 --> 01:43:19,380 before Mount or after motor is basically 2182 01:43:19,380 --> 01:43:23,100 before it is surrendered so if we have 2183 01:43:23,100 --> 01:43:28,980 uh on mounted we also have before 2184 01:43:31,260 --> 01:43:34,199 I will just say 2185 01:43:34,199 --> 01:43:35,940 I'm 2186 01:43:35,940 --> 01:43:39,440 about to be more 2187 01:43:39,480 --> 01:43:42,659 why does it say not because before Mount 2188 01:43:42,659 --> 01:43:45,480 is not presented 2189 01:43:45,480 --> 01:43:48,420 okay now I have called in before month 2190 01:43:48,420 --> 01:43:51,060 what does it say view has no exporter 2191 01:43:51,060 --> 01:43:52,679 named before 2192 01:43:52,679 --> 01:43:56,340 okay let's open up our uh 2193 01:43:56,340 --> 01:44:00,000 five cycle hook before Mount is there 2194 01:44:00,000 --> 01:44:04,400 and before grade is also there 2195 01:44:09,480 --> 01:44:13,219 let's put the 2196 01:44:16,260 --> 01:44:19,800 of we should be calling something like 2197 01:44:19,800 --> 01:44:22,400 this so 2198 01:44:31,580 --> 01:44:34,739 okay because it doesn't have a function 2199 01:44:34,739 --> 01:44:37,199 which takes no arguments it as a 2200 01:44:37,199 --> 01:44:39,239 function but this function was not like 2201 01:44:39,239 --> 01:44:40,380 that 2202 01:44:40,380 --> 01:44:42,840 that's forget about it and see what 2203 01:44:42,840 --> 01:44:43,920 happens 2204 01:44:43,920 --> 01:44:45,679 thank you 2205 01:44:45,679 --> 01:44:48,780 indirect exporter before mode connector 2206 01:44:48,780 --> 01:44:50,040 okay 2207 01:44:50,040 --> 01:44:53,460 okay so maybe it is not there 2208 01:44:53,460 --> 01:44:56,400 before Montrose and after options AP so 2209 01:44:56,400 --> 01:44:59,699 let's see what is their amount 2210 01:44:59,699 --> 01:45:03,900 ah like unwanted we have on before 2211 01:45:03,900 --> 01:45:06,900 okay 2212 01:45:07,980 --> 01:45:11,159 so on mounted on before 2213 01:45:11,159 --> 01:45:14,040 okay let's save it delete everything the 2214 01:45:14,040 --> 01:45:16,639 fresh off screen 2215 01:45:16,980 --> 01:45:21,119 okay could not establish connection 2216 01:45:21,119 --> 01:45:25,820 let's clear again refresh the page 2217 01:45:26,100 --> 01:45:28,619 I'm about to be mounted first because it 2218 01:45:28,619 --> 01:45:31,260 is uh called first 2219 01:45:31,260 --> 01:45:33,119 I'm about to be mounted and then after 2220 01:45:33,119 --> 01:45:35,219 that we are mounted so we now know that 2221 01:45:35,219 --> 01:45:38,580 uh this is a life cycle hook on before 2222 01:45:38,580 --> 01:45:42,420 moving what about create and create you 2223 01:45:42,420 --> 01:45:44,820 can still have the same same concept 2224 01:45:44,820 --> 01:45:48,380 on create 2225 01:45:48,619 --> 01:45:52,520 I don't know let's go here 2226 01:45:52,619 --> 01:45:53,940 create 2227 01:45:53,940 --> 01:45:57,560 a like on 2228 01:45:59,699 --> 01:46:02,880 on before update is there before is 2229 01:46:02,880 --> 01:46:04,560 there 2230 01:46:04,560 --> 01:46:07,639 on updated 2231 01:46:13,260 --> 01:46:16,260 hmm 2232 01:46:16,440 --> 01:46:19,440 okay so we don't have it it seems but we 2233 01:46:19,440 --> 01:46:22,520 have some other items we have activate 2234 01:46:22,520 --> 01:46:25,500 deactivate the error captured update 2235 01:46:25,500 --> 01:46:30,440 error let's go for updated on updated 2236 01:46:30,440 --> 01:46:34,340 on before updated 2237 01:46:38,159 --> 01:46:40,860 okay let's see 2238 01:46:40,860 --> 01:46:42,780 let's copy the same 2239 01:46:42,780 --> 01:46:46,080 and do whatever you want 2240 01:46:46,080 --> 01:46:49,080 updater 2241 01:46:49,980 --> 01:46:51,960 um before updated 2242 01:46:51,960 --> 01:46:56,179 I'm about to be I've updated 2243 01:46:57,900 --> 01:47:03,840 updated so let's save this and delete uh 2244 01:47:03,840 --> 01:47:05,520 refresh 2245 01:47:05,520 --> 01:47:08,340 first we are mounted we say like I'm 2246 01:47:08,340 --> 01:47:10,980 about to be mounted and I mounted so 2247 01:47:10,980 --> 01:47:13,340 Mount and on mode happens when we are 2248 01:47:13,340 --> 01:47:16,020 switching the page like when when we 2249 01:47:16,020 --> 01:47:18,119 change the page the object itself is 2250 01:47:18,119 --> 01:47:20,280 unmounted you again change the page it 2251 01:47:20,280 --> 01:47:23,280 is mounted so let's see increase salary 2252 01:47:23,280 --> 01:47:26,159 it is going to update 2253 01:47:26,159 --> 01:47:29,460 so what happened here when I press 2254 01:47:29,460 --> 01:47:31,679 increase salary it went to this function 2255 01:47:31,679 --> 01:47:34,560 and then it executed everything if you 2256 01:47:34,560 --> 01:47:37,080 could see that after this execute is 2257 01:47:37,080 --> 01:47:41,040 happen and this left function then U JS 2258 01:47:41,040 --> 01:47:43,739 Refuge is kicked in and then it was 2259 01:47:43,739 --> 01:47:46,139 about to update the salary then it 2260 01:47:46,139 --> 01:47:48,900 realized that we already have a hook for 2261 01:47:48,900 --> 01:47:51,119 two so before update it is saying hey 2262 01:47:51,119 --> 01:47:53,580 I'm going to I'm about to be updated and 2263 01:47:53,580 --> 01:47:56,520 after updated it says I am updated so 2264 01:47:56,520 --> 01:47:59,100 this is the way how 2265 01:47:59,100 --> 01:48:02,219 the life cycle who works if you want to 2266 01:48:02,219 --> 01:48:04,560 show something uh before update you show 2267 01:48:04,560 --> 01:48:07,320 this if you don't want to do that you 2268 01:48:07,320 --> 01:48:09,239 can change it can we play something here 2269 01:48:09,239 --> 01:48:12,540 more I will just take this one 2270 01:48:12,540 --> 01:48:14,760 and before I am going to update this now 2271 01:48:14,760 --> 01:48:17,400 this is not an ideal scenario but what I 2272 01:48:17,400 --> 01:48:20,639 will do I'm about to be updated 2273 01:48:20,639 --> 01:48:23,159 for 2274 01:48:23,159 --> 01:48:26,400 salary dot value 2275 01:48:26,400 --> 01:48:29,219 and what I'm going to say 2276 01:48:29,219 --> 01:48:31,500 I don't want this like instead of 2277 01:48:31,500 --> 01:48:34,440 thousand I will say minus so what 2278 01:48:34,440 --> 01:48:37,080 happens is whatever we do uh it will 2279 01:48:37,080 --> 01:48:38,580 increase there and it will 2280 01:48:38,580 --> 01:48:40,199 decrease it here 2281 01:48:40,199 --> 01:48:43,739 uh shall we try now increase salary 2282 01:48:43,739 --> 01:48:47,880 okay so uh for some weird reasons my 2283 01:48:47,880 --> 01:48:50,699 save is not accepting so I'll just uh 2284 01:48:50,699 --> 01:48:52,080 refresh it okay so 2285 01:48:52,080 --> 01:48:53,159 press 2286 01:48:53,159 --> 01:48:54,480 see here 2287 01:48:54,480 --> 01:48:57,719 I am about to be updated to 9 also 600. 2288 01:48:57,719 --> 01:48:59,760 but the moment I update it it Still 2289 01:48:59,760 --> 01:49:01,860 Remains the Same what happened at this 2290 01:49:01,860 --> 01:49:03,960 point I am reducing it again so you can 2291 01:49:03,960 --> 01:49:07,400 have the before update on after update 2292 01:49:07,400 --> 01:49:09,900 whatever you want and it will change 2293 01:49:09,900 --> 01:49:13,080 them again before mount on moved all 2294 01:49:13,080 --> 01:49:15,360 those values could be modified 2295 01:49:15,360 --> 01:49:17,960 did you notice something 2296 01:49:17,960 --> 01:49:22,500 let me go back here and 2297 01:49:22,500 --> 01:49:24,300 put something here 2298 01:49:24,300 --> 01:49:27,080 and say 2299 01:49:28,199 --> 01:49:30,060 minus 2300 01:49:30,060 --> 01:49:33,540 500. so each time when the value is 2301 01:49:33,540 --> 01:49:36,480 trying to be updated as a penalty I am 2302 01:49:36,480 --> 01:49:39,119 going to be reducing the 500 I will 2303 01:49:39,119 --> 01:49:40,980 reduce whatever they tried and then I'm 2304 01:49:40,980 --> 01:49:42,300 going to use it something 2305 01:49:42,300 --> 01:49:45,619 let's see one thing 2306 01:49:47,760 --> 01:49:49,139 okay 2307 01:49:49,139 --> 01:49:50,880 increase salary 2308 01:49:50,880 --> 01:49:52,800 now what happened 2309 01:49:52,800 --> 01:49:55,139 maximum recursive update statement 2310 01:49:55,139 --> 01:49:56,820 exceeded in a component 2311 01:49:56,820 --> 01:49:59,460 why is that because 2312 01:49:59,460 --> 01:50:02,580 you are trying to do something you are 2313 01:50:02,580 --> 01:50:05,159 changing the salary inside this function 2314 01:50:05,159 --> 01:50:07,679 and before your update you are again 2315 01:50:07,679 --> 01:50:09,659 modifying the salary that is all totally 2316 01:50:09,659 --> 01:50:13,619 fine but after you are updated you are 2317 01:50:13,619 --> 01:50:15,119 again trying to change the value which 2318 01:50:15,119 --> 01:50:17,340 means that it will again trigger this on 2319 01:50:17,340 --> 01:50:19,619 before update and again trigger this we 2320 01:50:19,619 --> 01:50:22,260 are trying to enter into a recursive or 2321 01:50:22,260 --> 01:50:25,619 an infinite Loop so what happens you see 2322 01:50:25,619 --> 01:50:26,719 here 2323 01:50:26,719 --> 01:50:31,260 so first we try to change to you see the 2324 01:50:31,260 --> 01:50:34,920 value in down here we try to change add 2325 01:50:34,920 --> 01:50:38,699 1000 or 8600 we are about to update to 2326 01:50:38,699 --> 01:50:41,460 9600 and then what happened we kick it 2327 01:50:41,460 --> 01:50:43,380 in here to on before update if we change 2328 01:50:43,380 --> 01:50:45,179 the value and then we 2329 01:50:45,179 --> 01:50:47,940 went on update we reduced the value the 2330 01:50:47,940 --> 01:50:50,100 moment we reduce it this is happening 2331 01:50:50,100 --> 01:50:52,500 after the render so which means that it 2332 01:50:52,500 --> 01:50:54,119 will again render and then again it was 2333 01:50:54,119 --> 01:50:54,960 reduced 2334 01:50:54,960 --> 01:50:56,639 reducing and then it went back so after 2335 01:50:56,639 --> 01:50:59,280 some time uh the stack Overflow happened 2336 01:50:59,280 --> 01:51:03,719 and it is lost and if I remove it here 2337 01:51:03,719 --> 01:51:05,760 when the before update is triggered 2338 01:51:05,760 --> 01:51:08,699 whatever value you change is not going 2339 01:51:08,699 --> 01:51:09,860 to 2340 01:51:09,860 --> 01:51:13,139 re-trigger or put you into a infinite 2341 01:51:13,139 --> 01:51:16,880 Loop let's see this one 2342 01:51:17,760 --> 01:51:19,080 we've seen 2343 01:51:19,080 --> 01:51:22,560 maybe we can give penalty here 500. 2344 01:51:22,560 --> 01:51:26,360 save this refresh 2345 01:51:27,380 --> 01:51:30,060 increase salary each time I try to 2346 01:51:30,060 --> 01:51:31,739 increase salary 2347 01:51:31,739 --> 01:51:34,739 I am going to reduce 500 analogy so I am 2348 01:51:34,739 --> 01:51:37,380 trying to put 11 000 2349 01:51:37,380 --> 01:51:40,199 but what to do what do I get okay maybe 2350 01:51:40,199 --> 01:51:43,260 I need to put minus 1500 whatever the 2351 01:51:43,260 --> 01:51:46,260 value that comes in like 8 000 600 I am 2352 01:51:46,260 --> 01:51:48,300 trying to add a thousand to nine 2353 01:51:48,300 --> 01:51:50,100 thousand six hundred so I will reduce it 2354 01:51:50,100 --> 01:51:53,159 to to keep it simple we'll change this 2355 01:51:53,159 --> 01:51:57,920 to 8500 so it will look nice 2356 01:51:58,080 --> 01:52:01,860 I try to add 1000 to 9500 what will 2357 01:52:01,860 --> 01:52:05,760 happen I reduce the amount 2500 so it 2358 01:52:05,760 --> 01:52:07,320 gets reduced 2359 01:52:07,320 --> 01:52:09,840 so it's quite straightforward but this 2360 01:52:09,840 --> 01:52:11,699 change is not going to trigger because 2361 01:52:11,699 --> 01:52:14,820 you are already about to updated so 2362 01:52:14,820 --> 01:52:17,040 whatever change you do is not going to 2363 01:52:17,040 --> 01:52:19,199 affect when you change something after 2364 01:52:19,199 --> 01:52:21,119 the update or after the render happens 2365 01:52:21,119 --> 01:52:23,580 it will again trigger it again and again 2366 01:52:23,580 --> 01:52:26,940 so that's the base idea there so that's 2367 01:52:26,940 --> 01:52:29,460 it uh we now know about how we can 2368 01:52:29,460 --> 01:52:31,679 expose properties using different props 2369 01:52:31,679 --> 01:52:35,639 and we know how to use the ref keyword 2370 01:52:35,639 --> 01:52:38,040 and when we change the values or when 2371 01:52:38,040 --> 01:52:40,860 you do something like this how the ref 2372 01:52:40,860 --> 01:52:44,699 is then going to affect our update 2373 01:52:44,699 --> 01:52:46,500 automatically and we also know a little 2374 01:52:46,500 --> 01:52:51,560 bit about the life cycle hooks 2375 01:52:54,679 --> 01:52:58,020 we were looking into UJS composition API 2376 01:52:58,020 --> 01:53:01,139 so far and now we will move into uh 2377 01:53:01,139 --> 01:53:04,260 router in the beginning I explained 2378 01:53:04,260 --> 01:53:06,679 something about Vita 2379 01:53:06,679 --> 01:53:10,619 so all these wheat and other JavaScript 2380 01:53:10,619 --> 01:53:13,860 Frameworks are constantly evolving so 2381 01:53:13,860 --> 01:53:16,260 the best way as I explained at the 2382 01:53:16,260 --> 01:53:19,199 beginning of this course is uh to always 2383 01:53:19,199 --> 01:53:22,199 look into the official documentation to 2384 01:53:22,199 --> 01:53:25,260 see how we to get started because they 2385 01:53:25,260 --> 01:53:27,840 might be changing something so the same 2386 01:53:27,840 --> 01:53:31,139 applies not only for beat it applies for 2387 01:53:31,139 --> 01:53:34,920 vue.js or for a router or Pina whatever 2388 01:53:34,920 --> 01:53:38,340 it is always go to the default 2389 01:53:38,340 --> 01:53:41,219 official documentation to see how to get 2390 01:53:41,219 --> 01:53:44,699 started this is a trick that I always 2391 01:53:44,699 --> 01:53:47,040 use for um instead of watching thousand 2392 01:53:47,040 --> 01:53:49,800 videos I always go to the default 2393 01:53:49,800 --> 01:53:52,020 official documentation and from there 2394 01:53:52,020 --> 01:53:53,699 I'm going to the doors to understand 2395 01:53:53,699 --> 01:53:56,760 something this applies not only for vgs 2396 01:53:56,760 --> 01:54:00,119 for all any new programming that 2397 01:54:00,119 --> 01:54:02,699 and now we are discussing about view 2398 01:54:02,699 --> 01:54:05,219 router to change the pages go to view 2399 01:54:05,219 --> 01:54:09,360 router and go to get started so to 2400 01:54:09,360 --> 01:54:12,840 install you need a view router at four 2401 01:54:12,840 --> 01:54:14,940 cool 2402 01:54:14,940 --> 01:54:18,239 this is the basic thing and and skill 2403 01:54:18,239 --> 01:54:19,500 this uh 2404 01:54:19,500 --> 01:54:22,679 what is this called terminal 2405 01:54:22,679 --> 01:54:25,880 and let's 2406 01:54:26,219 --> 01:54:28,699 close this application 2407 01:54:28,699 --> 01:54:31,920 npm install 2408 01:54:31,920 --> 01:54:34,739 view router 4. 2409 01:54:34,739 --> 01:54:37,020 so this is the first time since the 2410 01:54:37,020 --> 01:54:40,500 beginning of this video we are adding a 2411 01:54:40,500 --> 01:54:44,460 new uh component a new library before 2412 01:54:44,460 --> 01:54:47,100 that we were only installing the default 2413 01:54:47,100 --> 01:54:50,219 ones if you go to the package.json now 2414 01:54:50,219 --> 01:54:52,619 you will be able to see along with the 2415 01:54:52,619 --> 01:54:54,659 view now you have view router so view 2416 01:54:54,659 --> 01:54:56,639 router is water the one that we 2417 01:54:56,639 --> 01:55:00,239 installed now this expects any view 2418 01:55:00,239 --> 01:55:04,920 router version 4.1.6 and above so 2419 01:55:04,920 --> 01:55:06,960 anything you install again like pina 2420 01:55:06,960 --> 01:55:09,719 stores or some 3js libraries whatever it 2421 01:55:09,719 --> 01:55:12,239 is everything is going to be 2422 01:55:12,239 --> 01:55:14,520 uh head into the dependencies here next 2423 01:55:14,520 --> 01:55:17,100 time when you are saving it into your 2424 01:55:17,100 --> 01:55:20,820 git repository or something do remember 2425 01:55:20,820 --> 01:55:23,820 to add option okay we're getting more by 2426 01:55:23,820 --> 01:55:26,159 default is already there uh okay so 2427 01:55:26,159 --> 01:55:28,080 since I did take more uh ignores the 2428 01:55:28,080 --> 01:55:31,380 node modules uh in case uh any of this 2429 01:55:31,380 --> 01:55:35,400 uh cores or this demo will be present in 2430 01:55:35,400 --> 01:55:37,860 the GitHub you can get the source code 2431 01:55:37,860 --> 01:55:41,820 from the description uh of this video 2432 01:55:41,820 --> 01:55:44,400 all you need to do is just open up run 2433 01:55:44,400 --> 01:55:48,420 npm install and then run your and you 2434 01:55:48,420 --> 01:55:49,619 should be able to get this up and 2435 01:55:49,619 --> 01:55:51,239 running and you can play with 2436 01:55:51,239 --> 01:55:53,520 it and now that we have installed a 2437 01:55:53,520 --> 01:55:54,960 router 2438 01:55:54,960 --> 01:55:57,900 how does a router box and see if they 2439 01:55:57,900 --> 01:55:59,460 have some kind of 2440 01:55:59,460 --> 01:56:02,780 explanation for this 2441 01:56:07,040 --> 01:56:10,739 whole course is just to get a basic idea 2442 01:56:10,739 --> 01:56:14,580 not any in-depth video so let's see 2443 01:56:14,580 --> 01:56:17,400 whether they have something 2444 01:56:17,400 --> 01:56:20,400 okay I don't want to do this now uh what 2445 01:56:20,400 --> 01:56:22,500 I will do I will directly go ahead there 2446 01:56:22,500 --> 01:56:25,679 is one thing called as uh use router 2447 01:56:25,679 --> 01:56:28,020 first first and foremost thing first 2448 01:56:28,020 --> 01:56:31,679 let's see in there one uh getting 2449 01:56:31,679 --> 01:56:33,300 started 2450 01:56:33,300 --> 01:56:35,520 we have uh most important thing is 2451 01:56:35,520 --> 01:56:38,040 router link and router view those are 2452 01:56:38,040 --> 01:56:40,380 the two things even you don't need a 2453 01:56:40,380 --> 01:56:42,480 router link the important thing that you 2454 01:56:42,480 --> 01:56:46,080 need is a router View and you need to uh 2455 01:56:46,080 --> 01:56:50,659 add this JavaScript method or JavaScript 2456 01:56:50,659 --> 01:56:53,460 file you need to create a file to handle 2457 01:56:53,460 --> 01:56:56,400 it also so let's do this that's what 2458 01:56:56,400 --> 01:56:58,139 we're going to learn in this section I 2459 01:56:58,139 --> 01:57:00,679 will go inside 2460 01:57:04,980 --> 01:57:10,040 first thing let's close everything here 2461 01:57:10,800 --> 01:57:14,219 okay let's come back to this page this 2462 01:57:14,219 --> 01:57:15,960 is because we are using typescript and 2463 01:57:15,960 --> 01:57:17,880 that's the reason why we have a just 2464 01:57:17,880 --> 01:57:19,699 type checking 2465 01:57:19,699 --> 01:57:24,060 let me create a component called route 2466 01:57:24,060 --> 01:57:28,699 sorry not a component uh file 2467 01:57:28,880 --> 01:57:34,040 routes that uh typescript 2468 01:57:34,320 --> 01:57:37,560 okay so this is the only file which is 2469 01:57:37,560 --> 01:57:41,520 going to handle all our routes now we 2470 01:57:41,520 --> 01:57:44,520 have already known that index 2471 01:57:44,520 --> 01:57:47,820 loads main tscript so whatever you put 2472 01:57:47,820 --> 01:57:49,800 in your main case will again be loaded 2473 01:57:49,800 --> 01:57:52,139 into your application so go to main TS 2474 01:57:52,139 --> 01:57:55,739 and along with importing The View you 2475 01:57:55,739 --> 01:58:00,239 now going to import the routes from the 2476 01:58:00,239 --> 01:58:01,679 same location right 2477 01:58:01,679 --> 01:58:04,139 loads 2478 01:58:04,139 --> 01:58:07,679 dot TS this is present in 2479 01:58:07,679 --> 01:58:09,659 same location 2480 01:58:09,659 --> 01:58:12,500 routes 2481 01:58:13,139 --> 01:58:14,699 what does it say 2482 01:58:14,699 --> 01:58:17,280 is declared but its value is never used 2483 01:58:17,280 --> 01:58:19,440 of course I'm going to use it 2484 01:58:19,440 --> 01:58:23,040 so use routes 2485 01:58:23,040 --> 01:58:26,099 so I'm just saying that hey view when 2486 01:58:26,099 --> 01:58:27,599 you're creating the application and 2487 01:58:27,599 --> 01:58:30,060 before you mount it please use this 2488 01:58:30,060 --> 01:58:33,540 route so it also said yes should be 2489 01:58:33,540 --> 01:58:37,980 there is it fine now import path can not 2490 01:58:37,980 --> 01:58:40,560 end this TS extension consider importing 2491 01:58:40,560 --> 01:58:41,940 JavaScript 2492 01:58:41,940 --> 01:58:44,340 okay why not okay so now that we have 2493 01:58:44,340 --> 01:58:48,360 our empty router uh these uh maybe this 2494 01:58:48,360 --> 01:58:50,639 is quite straightforward and quite 2495 01:58:50,639 --> 01:58:53,099 simple when we are dealing with uh 2496 01:58:53,099 --> 01:58:55,400 routes 2497 01:58:55,400 --> 01:58:58,080 what we need to do is we need to create 2498 01:58:58,080 --> 01:59:00,239 a router that's uh that's the whole 2499 01:59:00,239 --> 01:59:03,599 purpose of this create a router and 2500 01:59:03,599 --> 01:59:05,460 Export it that's the whole purpose of 2501 01:59:05,460 --> 01:59:07,920 this external file how do we create a 2502 01:59:07,920 --> 01:59:11,580 router we need a method which is already 2503 01:59:11,580 --> 01:59:13,500 a part of 2504 01:59:13,500 --> 01:59:14,159 um 2505 01:59:14,159 --> 01:59:16,380 view router so we added this right like 2506 01:59:16,380 --> 01:59:18,780 here we added the view router so view 2507 01:59:18,780 --> 01:59:21,239 router is there go back to our routes 2508 01:59:21,239 --> 01:59:23,880 and let's say 2509 01:59:23,880 --> 01:59:25,380 Imports 2510 01:59:25,380 --> 01:59:27,179 a method I'm not going to see what 2511 01:59:27,179 --> 01:59:29,300 method now like import a method from 2512 01:59:29,300 --> 01:59:33,500 view router and what is the method 2513 01:59:33,500 --> 01:59:37,920 let me press control and then 2514 01:59:37,920 --> 01:59:40,679 the space it will show me all the 2515 01:59:40,679 --> 01:59:43,619 properties enums and everything there if 2516 01:59:43,619 --> 01:59:44,820 I go down 2517 01:59:44,820 --> 01:59:48,659 okay so see here whatever with the cube 2518 01:59:48,659 --> 01:59:52,940 sign that means these are all uh 2519 01:59:53,460 --> 01:59:57,119 some of the methods so I have I need one 2520 01:59:57,119 --> 01:59:58,800 thing which is a create router method 2521 01:59:58,800 --> 02:00:00,780 because I already know this is the 2522 02:00:00,780 --> 02:00:02,639 method which creates and even the name 2523 02:00:02,639 --> 02:00:05,159 is also straightforward let's not do 2524 02:00:05,159 --> 02:00:07,199 anything let's just create something and 2525 02:00:07,199 --> 02:00:11,400 call as router and the create router and 2526 02:00:11,400 --> 02:00:14,480 process method export this method out 2527 02:00:14,480 --> 02:00:17,280 you cannot export directly to default 2528 02:00:17,280 --> 02:00:19,920 yeah declaration expected default export 2529 02:00:19,920 --> 02:00:22,199 a router from here and go to your main 2530 02:00:22,199 --> 02:00:24,659 application uh you are importing router 2531 02:00:24,659 --> 02:00:26,460 from this routes and you are using so 2532 02:00:26,460 --> 02:00:29,040 you are saying that hey I have a file 2533 02:00:29,040 --> 02:00:32,280 called outs.js and it is exporting and 2534 02:00:32,280 --> 02:00:35,580 named export called router and just 2535 02:00:35,580 --> 02:00:38,639 because we are exporting it as a router 2536 02:00:38,639 --> 02:00:41,520 you need to have the name so you're 2537 02:00:41,520 --> 02:00:43,320 exporting it as router and use it 2538 02:00:43,320 --> 02:00:47,480 everything is fine now let us 2539 02:00:47,699 --> 02:00:51,420 run npm run run through to see whether 2540 02:00:51,420 --> 02:00:55,080 we are able to work on this or not 2541 02:00:55,080 --> 02:00:56,400 press f2 2542 02:00:56,400 --> 02:00:58,560 there is an error which is that 2543 02:00:58,560 --> 02:01:01,199 in the view router JS options is 2544 02:01:01,199 --> 02:01:03,719 undefined so we know we have not defined 2545 02:01:03,719 --> 02:01:06,000 the options even though we have told the 2546 02:01:06,000 --> 02:01:07,980 view router to create a router he 2547 02:01:07,980 --> 02:01:09,420 doesn't know what it needs to do because 2548 02:01:09,420 --> 02:01:11,219 it has a couple of options you need to 2549 02:01:11,219 --> 02:01:13,320 provide those options to understand what 2550 02:01:13,320 --> 02:01:16,020 are the options I always do one thing if 2551 02:01:16,020 --> 02:01:17,880 in case I am dealing with anything 2552 02:01:17,880 --> 02:01:20,340 related view or react yes or whatever it 2553 02:01:20,340 --> 02:01:22,080 is just go to the definitions and see 2554 02:01:22,080 --> 02:01:24,060 definition what does it do it will open 2555 02:01:24,060 --> 02:01:26,280 up the source code and show what is 2556 02:01:26,280 --> 02:01:28,679 there go to the definitions and this is 2557 02:01:28,679 --> 02:01:30,179 expecting something called router 2558 02:01:30,179 --> 02:01:32,699 options and go to the router options and 2559 02:01:32,699 --> 02:01:34,440 the easiest way is you could see like 2560 02:01:34,440 --> 02:01:37,380 pressing F2 okay just select it and here 2561 02:01:37,380 --> 02:01:39,360 it is not exporting it is actually 2562 02:01:39,360 --> 02:01:43,739 extending also which means that let's do 2563 02:01:43,739 --> 02:01:46,320 it is extending and it is extending 2564 02:01:46,320 --> 02:01:47,880 something called path parser so 2565 02:01:47,880 --> 02:01:50,099 everything will be here it is expecting 2566 02:01:50,099 --> 02:01:53,040 a history it is expecting a route 2567 02:01:53,040 --> 02:01:55,560 what does it say ah you see they already 2568 02:01:55,560 --> 02:01:57,179 have an example 2569 02:01:57,179 --> 02:02:00,599 you can call the history and you can use 2570 02:02:00,599 --> 02:02:03,179 a router for example a route should be 2571 02:02:03,179 --> 02:02:05,820 blah blah blah blah blah something but 2572 02:02:05,820 --> 02:02:08,159 anyhow so history is nothing but web 2573 02:02:08,159 --> 02:02:09,719 history so when you press this forward 2574 02:02:09,719 --> 02:02:12,239 back button it will move that so for 2575 02:02:12,239 --> 02:02:13,800 this they already have a method called 2576 02:02:13,800 --> 02:02:16,080 creative history that's totally fine for 2577 02:02:16,080 --> 02:02:19,199 routes itself they are providing 2578 02:02:19,199 --> 02:02:21,960 an array of road record what is the 2579 02:02:21,960 --> 02:02:24,239 route record that's F2 is there and go 2580 02:02:24,239 --> 02:02:26,639 here route record is 2581 02:02:26,639 --> 02:02:28,159 exporting 2582 02:02:28,159 --> 02:02:31,739 different items so this is like Aura you 2583 02:02:31,739 --> 02:02:34,199 can use route record single view single 2584 02:02:34,199 --> 02:02:36,360 view children multiple view you can do 2585 02:02:36,360 --> 02:02:38,159 anything you want let's take multiple 2586 02:02:38,159 --> 02:02:41,040 view for example so you are exporting 2587 02:02:41,040 --> 02:02:43,560 again it is extending the router record 2588 02:02:43,560 --> 02:02:46,920 base which means that a router record 2589 02:02:46,920 --> 02:02:49,860 base will have all the properties 2590 02:02:49,860 --> 02:02:51,960 so you need to give your path something 2591 02:02:51,960 --> 02:02:54,000 like backslash and whatever is the path 2592 02:02:54,000 --> 02:02:56,699 and you need to you redirect okay you 2593 02:02:56,699 --> 02:02:58,380 see that there is a question mark which 2594 02:02:58,380 --> 02:03:01,320 means you can can or cannot do that like 2595 02:03:01,320 --> 02:03:03,599 it is up to you it's optional but this 2596 02:03:03,599 --> 02:03:05,580 path is mandatory 2597 02:03:05,580 --> 02:03:08,580 name is also not mandatory 2598 02:03:08,580 --> 02:03:10,800 okay only the path is mandatory here 2599 02:03:10,800 --> 02:03:13,260 nothing else is mandatory okay so this 2600 02:03:13,260 --> 02:03:15,659 is how you go inside and look into it 2601 02:03:15,659 --> 02:03:17,520 the other ways when you start writing 2602 02:03:17,520 --> 02:03:19,380 intelligence will kick in and show 2603 02:03:19,380 --> 02:03:21,780 everything so let's do this first and 2604 02:03:21,780 --> 02:03:24,000 foremost history we already saw 2605 02:03:24,000 --> 02:03:26,880 something called create history let's go 2606 02:03:26,880 --> 02:03:30,239 here import that method create a web 2607 02:03:30,239 --> 02:03:32,159 history or something 2608 02:03:32,159 --> 02:03:34,800 create web history because this was 2609 02:03:34,800 --> 02:03:36,599 mandatory that's the reason why we are 2610 02:03:36,599 --> 02:03:38,880 using it how do I know it is mandatory 2611 02:03:38,880 --> 02:03:42,900 go to F12 go to the options it does not 2612 02:03:42,900 --> 02:03:44,460 have a question mark which means it is 2613 02:03:44,460 --> 02:03:46,800 mandatory routes is mandatory what will 2614 02:03:46,800 --> 02:03:48,780 happen if we do not put like the scroll 2615 02:03:48,780 --> 02:03:51,420 Behavior parse query those are our like 2616 02:03:51,420 --> 02:03:53,280 with question marker so it are not 2617 02:03:53,280 --> 02:03:55,260 mandatory and there are what will happen 2618 02:03:55,260 --> 02:03:58,199 if we don't give a mandatory value let's 2619 02:03:58,199 --> 02:04:01,760 try to save this and see the error here 2620 02:04:01,760 --> 02:04:05,060 save this 2621 02:04:05,699 --> 02:04:07,980 see route is undefined because route is 2622 02:04:07,980 --> 02:04:10,139 mandatory a mandatory one should be 2623 02:04:10,139 --> 02:04:12,599 presenter router 2624 02:04:12,599 --> 02:04:15,000 routes what was it it was an array we 2625 02:04:15,000 --> 02:04:17,159 already saw that so we open up an array 2626 02:04:17,159 --> 02:04:19,739 and it was having some kind of uh 2627 02:04:19,739 --> 02:04:22,380 something called as a road record base 2628 02:04:22,380 --> 02:04:24,840 which had path is the only mandatory 2629 02:04:24,840 --> 02:04:28,679 value so let's go to routes and say 2630 02:04:28,679 --> 02:04:29,880 path 2631 02:04:29,880 --> 02:04:33,060 and let's keep it very simple like this 2632 02:04:33,060 --> 02:04:36,139 why the path has an error 2633 02:04:36,139 --> 02:04:40,500 okay so array should have 2634 02:04:40,500 --> 02:04:42,780 an object object or something like this 2635 02:04:42,780 --> 02:04:44,280 Dynamic object 2636 02:04:44,280 --> 02:04:47,159 save it do we have any other error 2637 02:04:47,159 --> 02:04:50,340 no error that's cool so we managed to 2638 02:04:50,340 --> 02:04:52,139 build our uh 2639 02:04:52,139 --> 02:04:54,540 router but we are not using the router 2640 02:04:54,540 --> 02:04:57,540 anywhere so this is fine 2641 02:04:57,540 --> 02:04:58,500 um 2642 02:04:58,500 --> 02:05:03,599 what if we want to use one more router 2643 02:05:03,599 --> 02:05:06,960 so we do the same here 2644 02:05:06,960 --> 02:05:10,619 and say path this instead of backslash 2645 02:05:10,619 --> 02:05:12,480 we say backslash demo 2646 02:05:12,480 --> 02:05:15,380 and that's it 2647 02:05:15,840 --> 02:05:18,179 let's see 2648 02:05:18,179 --> 02:05:19,860 refresh 2649 02:05:19,860 --> 02:05:21,540 perfect 2650 02:05:21,540 --> 02:05:25,619 now go to your uh Main Place we are 2651 02:05:25,619 --> 02:05:27,060 using the router we are importing the 2652 02:05:27,060 --> 02:05:30,599 router and we are using the router 2653 02:05:30,599 --> 02:05:34,219 so it's from route.js 2654 02:05:34,500 --> 02:05:36,960 okay so now that we have created the 2655 02:05:36,960 --> 02:05:39,119 router we have later but will it work if 2656 02:05:39,119 --> 02:05:40,739 I put like this 2657 02:05:40,739 --> 02:05:43,580 demo 2658 02:05:45,000 --> 02:05:48,420 now it's not working why because even 2659 02:05:48,420 --> 02:05:50,760 though I have put the route and even 2660 02:05:50,760 --> 02:05:52,760 though I have put 2661 02:05:52,760 --> 02:05:55,500 different routes and we updated a web 2662 02:05:55,500 --> 02:05:58,560 history we are not consuming it how do 2663 02:05:58,560 --> 02:06:01,800 we consume a router to consume a router 2664 02:06:01,800 --> 02:06:03,420 you need to use something called as a 2665 02:06:03,420 --> 02:06:07,440 router view so basically instead of the 2666 02:06:07,440 --> 02:06:10,500 app.js or like here in app.js we have 2667 02:06:10,500 --> 02:06:14,699 this Global icons here and where is this 2668 02:06:14,699 --> 02:06:17,099 getting saved it is getting saved in a 2669 02:06:17,099 --> 02:06:18,500 place called 2670 02:06:18,500 --> 02:06:22,199 index.j so instead of mounting uh 2671 02:06:22,199 --> 02:06:25,380 directly there you need to mount the 2672 02:06:25,380 --> 02:06:27,840 router view then router view will kick 2673 02:06:27,840 --> 02:06:29,580 in and do everything that you need 2674 02:06:29,580 --> 02:06:31,500 so what I am going to do I am going to 2675 02:06:31,500 --> 02:06:32,460 do something 2676 02:06:32,460 --> 02:06:34,940 here 2677 02:06:34,940 --> 02:06:38,280 instead of this device I will just see 2678 02:06:38,280 --> 02:06:41,280 your router View 2679 02:06:41,280 --> 02:06:44,239 just save 2680 02:06:45,840 --> 02:06:48,540 there are so many errors what is the 2681 02:06:48,540 --> 02:06:50,760 first error that we have just remove the 2682 02:06:50,760 --> 02:06:52,020 Demo First 2683 02:06:52,020 --> 02:06:55,099 we press this 2684 02:06:55,139 --> 02:06:57,739 file index.html 2685 02:06:57,739 --> 02:07:01,619 is not able to parse let's maximize it 2686 02:07:01,619 --> 02:07:02,699 to see 2687 02:07:02,699 --> 02:07:05,760 unable to parse invalid character of 2688 02:07:05,760 --> 02:07:09,420 tagline file in index HTM or line 11 and 2689 02:07:09,420 --> 02:07:12,260 the column eight 2690 02:07:12,360 --> 02:07:14,940 it is not able to just say we have to 2691 02:07:14,940 --> 02:07:17,840 profit 2692 02:07:18,360 --> 02:07:21,780 okay so even though you give a router 2693 02:07:21,780 --> 02:07:24,540 review it is still mounting because the 2694 02:07:24,540 --> 02:07:26,219 app view is not mounting onto the 2695 02:07:26,219 --> 02:07:28,460 foreign 2696 02:07:35,580 --> 02:07:37,980 so in the app you let us make it let us 2697 02:07:37,980 --> 02:07:40,320 create one more component or like just 2698 02:07:40,320 --> 02:07:43,580 cut them all out 2699 02:07:43,980 --> 02:07:46,860 okay save it 2700 02:07:46,860 --> 02:07:50,760 so they should be gone move it back to a 2701 02:07:50,760 --> 02:07:52,860 complete here 2702 02:07:52,860 --> 02:07:55,320 save it 2703 02:07:55,320 --> 02:07:57,719 okay so everything is now a part of 2704 02:07:57,719 --> 02:07:59,040 hello world we have two components 2705 02:07:59,040 --> 02:08:00,840 allowable components and demo components 2706 02:08:00,840 --> 02:08:03,540 in the app view instead of calling the 2707 02:08:03,540 --> 02:08:06,900 demo like this just close this one 2708 02:08:06,900 --> 02:08:11,780 and in the template just say router View 2709 02:08:12,420 --> 02:08:15,300 saved and the remote component let us 2710 02:08:15,300 --> 02:08:18,360 move it we are not using it anymore 2711 02:08:18,360 --> 02:08:20,280 what happened here 2712 02:08:20,280 --> 02:08:22,860 everything is fine but the router 2713 02:08:22,860 --> 02:08:24,960 doesn't know what what no match for 2714 02:08:24,960 --> 02:08:29,159 location with the Slash 2715 02:08:29,159 --> 02:08:34,880 backslash so let's say demo 2716 02:08:35,159 --> 02:08:37,380 no match phone for location with path 2717 02:08:37,380 --> 02:08:40,980 backslash demo so what does it say uh 2718 02:08:40,980 --> 02:08:43,800 location is there of course obviously 2719 02:08:43,800 --> 02:08:47,340 when we go to this main TS router we 2720 02:08:47,340 --> 02:08:49,199 have the location but what have we done 2721 02:08:49,199 --> 02:08:53,699 now did we specify any uh path the path 2722 02:08:53,699 --> 02:08:55,380 is there but we did we specify any 2723 02:08:55,380 --> 02:08:58,440 component if we specify any child that 2724 02:08:58,440 --> 02:09:00,080 we specify any 2725 02:09:00,080 --> 02:09:03,300 name nothing is there so let's give a 2726 02:09:03,300 --> 02:09:05,280 name name start mandatory let's just say 2727 02:09:05,280 --> 02:09:10,099 like the home and here let us just say 2728 02:09:10,099 --> 02:09:12,119 demo page 2729 02:09:12,119 --> 02:09:14,460 and I will add one more now it is 2730 02:09:14,460 --> 02:09:16,739 getting clumsy we are adding it again 2731 02:09:16,739 --> 02:09:20,659 and I just take them out constantly 2732 02:09:21,139 --> 02:09:25,619 route so it's equal to again cut them 2733 02:09:25,619 --> 02:09:27,980 all out 2734 02:09:28,080 --> 02:09:30,119 paste it here 2735 02:09:30,119 --> 02:09:32,340 and the routes is equal to 2736 02:09:32,340 --> 02:09:36,239 routes so now it's uh it's it's okay it 2737 02:09:36,239 --> 02:09:38,280 needs little arguments now 2738 02:09:38,280 --> 02:09:40,500 create router 2739 02:09:40,500 --> 02:09:42,119 and 2740 02:09:42,119 --> 02:09:46,380 export router now these are my 2741 02:09:46,380 --> 02:09:47,940 routes 2742 02:09:47,940 --> 02:09:50,040 I don't know whether you call it as root 2743 02:09:50,040 --> 02:09:52,440 or router you know 2744 02:09:52,440 --> 02:09:56,960 I'm being I'm calling this route 2745 02:09:57,679 --> 02:10:00,960 uh component we need a component what is 2746 02:10:00,960 --> 02:10:03,619 a component whether it is a hello world 2747 02:10:03,619 --> 02:10:06,540 where do we get it I need to import them 2748 02:10:06,540 --> 02:10:10,139 first so along with this import 2749 02:10:10,139 --> 02:10:14,840 import hello world from 2750 02:10:14,840 --> 02:10:19,580 components hello world 2751 02:10:19,920 --> 02:10:21,840 Dot View 2752 02:10:21,840 --> 02:10:27,440 and import demo from 2753 02:10:27,440 --> 02:10:30,420 components demo Dot View 2754 02:10:30,420 --> 02:10:33,780 okay now I'm importing hello world and 2755 02:10:33,780 --> 02:10:36,420 putting them so here we can easily say 2756 02:10:36,420 --> 02:10:38,219 that it says the component is not 2757 02:10:38,219 --> 02:10:40,020 defined defined course it is not defined 2758 02:10:40,020 --> 02:10:44,280 I have not home will be hello world 2759 02:10:44,280 --> 02:10:48,080 and here 2760 02:10:48,599 --> 02:10:51,060 component is 2761 02:10:51,060 --> 02:10:52,320 Dem 2762 02:10:52,320 --> 02:10:54,060 cool save 2763 02:10:54,060 --> 02:10:56,520 now we have whenever the backslash is 2764 02:10:56,520 --> 02:10:58,739 there we are going to hello world and 2765 02:10:58,739 --> 02:11:00,840 whenever the backslash demo is there we 2766 02:11:00,840 --> 02:11:03,060 are going to demo that's what we are 2767 02:11:03,060 --> 02:11:04,980 telling our application to do 2768 02:11:04,980 --> 02:11:07,380 but what it does instead 2769 02:11:07,380 --> 02:11:11,060 Whenever there is a backflow update 2770 02:11:13,320 --> 02:11:15,780 okay now this is working fine you know 2771 02:11:15,780 --> 02:11:18,480 why because whenever there is a 2772 02:11:18,480 --> 02:11:20,900 backslash what is the same 2773 02:11:20,900 --> 02:11:24,119 required a prop at a hello world amount 2774 02:11:24,119 --> 02:11:28,320 that's why the prop message is required 2775 02:11:28,320 --> 02:11:31,940 at present let us keep this simple uh 2776 02:11:31,940 --> 02:11:34,980 we need to spend the message 2777 02:11:34,980 --> 02:11:38,400 so there are different ways to handle 2778 02:11:38,400 --> 02:11:40,320 this like there are more than one ways 2779 02:11:40,320 --> 02:11:42,599 to handle this because hello world has 2780 02:11:42,599 --> 02:11:44,760 is exporting a property or defining a 2781 02:11:44,760 --> 02:11:47,040 property called the message and it is 2782 02:11:47,040 --> 02:11:49,980 also consuming it here as a double curly 2783 02:11:49,980 --> 02:11:52,500 braces inside the H1 so it is expecting 2784 02:11:52,500 --> 02:11:56,119 some above the account one so what we do 2785 02:11:56,119 --> 02:12:00,300 currently just for this demo purpose I 2786 02:12:00,300 --> 02:12:02,159 will show a different way that in 2787 02:12:02,159 --> 02:12:04,440 another video we'll look into it in 2788 02:12:04,440 --> 02:12:08,040 depth how we can maintain a different 2789 02:12:08,040 --> 02:12:11,040 Horizon 2790 02:12:11,219 --> 02:12:14,219 Dynamic values So currently along with 2791 02:12:14,219 --> 02:12:15,719 the component it is expecting some 2792 02:12:15,719 --> 02:12:16,800 property 2793 02:12:16,800 --> 02:12:19,800 we know what is the property even though 2794 02:12:19,800 --> 02:12:22,679 it is not shown in the intelligence I 2795 02:12:22,679 --> 02:12:25,679 know that it is a property called 2796 02:12:25,679 --> 02:12:27,360 uh 2797 02:12:27,360 --> 02:12:28,860 MSG 2798 02:12:28,860 --> 02:12:31,080 I will go back to my route 2799 02:12:31,080 --> 02:12:33,780 and say there is a property called MSG 2800 02:12:33,780 --> 02:12:36,960 it is expected I am saying give it hello 2801 02:12:36,960 --> 02:12:39,060 world 3. 2802 02:12:39,060 --> 02:12:42,020 press save 2803 02:12:42,300 --> 02:12:44,760 hello world three so this is how you 2804 02:12:44,760 --> 02:12:47,179 pass a property to an imported component 2805 02:12:47,179 --> 02:12:49,800 but there are other ways to dynamically 2806 02:12:49,800 --> 02:12:52,079 import as well but we will not focus on 2807 02:12:52,079 --> 02:12:54,060 it in our presenter we'll just keep it 2808 02:12:54,060 --> 02:12:56,579 simple so uh path is there and the 2809 02:12:56,579 --> 02:12:58,139 moment I press 2810 02:12:58,139 --> 02:13:02,579 demo I go into my demo page so how 2811 02:13:02,579 --> 02:13:04,920 because backslash demo gives me the demo 2812 02:13:04,920 --> 02:13:06,840 page with component dim and that gives 2813 02:13:06,840 --> 02:13:08,880 even this everything with the worker 2814 02:13:08,880 --> 02:13:11,699 minus will work and if I go directly to 2815 02:13:11,699 --> 02:13:14,119 this 2816 02:13:14,940 --> 02:13:18,980 now I want you to know something 2817 02:13:19,739 --> 02:13:24,060 it again went back to 8500 so whenever 2818 02:13:24,060 --> 02:13:26,820 the application is mounted it is reading 2819 02:13:26,820 --> 02:13:29,699 the values again let's go back to our 2820 02:13:29,699 --> 02:13:32,520 demo app what's happening is whenever I 2821 02:13:32,520 --> 02:13:36,300 change the value here from the URL it is 2822 02:13:36,300 --> 02:13:38,579 a refreshing the page it is not a single 2823 02:13:38,579 --> 02:13:40,260 way of course it is a single page 2824 02:13:40,260 --> 02:13:42,179 component but it is refreshing the page 2825 02:13:42,179 --> 02:13:44,579 again I don't need this to happen I need 2826 02:13:44,579 --> 02:13:46,560 to have some kind of navigation buttons 2827 02:13:46,560 --> 02:13:48,960 when I press those buttons I need to 2828 02:13:48,960 --> 02:13:52,880 change the page but without changing the 2829 02:13:52,880 --> 02:13:55,980 uh refreshing the view or refreshing the 2830 02:13:55,980 --> 02:13:58,880 Visa I'm going to app 2831 02:13:58,880 --> 02:14:02,040 above the router view I'm going to add 2832 02:14:02,040 --> 02:14:04,139 one more View 2833 02:14:04,139 --> 02:14:06,840 and let's say 2834 02:14:06,840 --> 02:14:09,480 save this and nothing should be seen 2835 02:14:09,480 --> 02:14:11,040 because we are not doing anything here 2836 02:14:11,040 --> 02:14:12,360 now 2837 02:14:12,360 --> 02:14:13,820 in the app 2838 02:14:13,820 --> 02:14:17,119 you do 2839 02:14:21,440 --> 02:14:26,400 first let us see uh which gives me to 2840 02:14:26,400 --> 02:14:29,400 google.com 2841 02:14:29,520 --> 02:14:33,619 and see if it works uh 2842 02:14:33,960 --> 02:14:35,219 Google 2843 02:14:35,219 --> 02:14:37,199 just see if you're there we are getting 2844 02:14:37,199 --> 02:14:39,560 this Google so it's coming up on the top 2845 02:14:39,560 --> 02:14:43,860 uh I need something I need this to be uh 2846 02:14:43,860 --> 02:14:46,500 I'm going to do an inline style and I'm 2847 02:14:46,500 --> 02:14:48,560 going to say the position is absolute 2848 02:14:48,560 --> 02:14:53,219 position is absolute 2849 02:14:53,219 --> 02:14:55,860 absolute absolute means it is not a 2850 02:14:55,860 --> 02:14:58,159 binder 2 anywhere so it should be now 2851 02:14:58,159 --> 02:15:00,420 hanging around 2852 02:15:00,420 --> 02:15:02,940 uh what happened the white space of 2853 02:15:02,940 --> 02:15:04,920 course white space 2854 02:15:04,920 --> 02:15:07,260 it's hanging around now it's not there 2855 02:15:07,260 --> 02:15:10,860 it is absolute and it has a top margin 2856 02:15:10,860 --> 02:15:14,579 of 0 amp so it always goes to the top 2857 02:15:14,579 --> 02:15:17,940 and it's not only that it will also have 2858 02:15:17,940 --> 02:15:22,139 a left margin of uh let's say one m on 2859 02:15:22,139 --> 02:15:24,360 the top on one name on the left so it 2860 02:15:24,360 --> 02:15:27,380 will be there like that 2861 02:15:27,780 --> 02:15:32,099 okay uh if I add one more 2862 02:15:32,099 --> 02:15:34,139 ah 2863 02:15:34,139 --> 02:15:37,020 am I seeing it uh one by one or in the 2864 02:15:37,020 --> 02:15:39,780 flex okay that's perfect though so now I 2865 02:15:39,780 --> 02:15:41,040 have three 2866 02:15:41,040 --> 02:15:43,920 I have three and when I press one I'm 2867 02:15:43,920 --> 02:15:46,520 going to 2868 02:15:50,460 --> 02:15:52,340 ah okay 2869 02:15:52,340 --> 02:15:55,739 oh what happens is that when I press 2870 02:15:55,739 --> 02:16:00,420 this since it is uh taking only relative 2871 02:16:00,420 --> 02:16:03,900 absolute value that's fine let's do like 2872 02:16:03,900 --> 02:16:05,880 this so let's give the protocol as well 2873 02:16:05,880 --> 02:16:09,420 and say uh no no this is not relative my 2874 02:16:09,420 --> 02:16:12,800 brother this is absolute 2875 02:16:12,800 --> 02:16:15,540 uh okay save it 2876 02:16:15,540 --> 02:16:17,520 refresh 2877 02:16:17,520 --> 02:16:19,800 so now this is not relative this is 2878 02:16:19,800 --> 02:16:22,260 absolute the last one is still relative 2879 02:16:22,260 --> 02:16:24,840 when I press that it says that it tries 2880 02:16:24,840 --> 02:16:28,139 to go to uh the page google.com and it's 2881 02:16:28,139 --> 02:16:29,820 not able to find anything that's totally 2882 02:16:29,820 --> 02:16:33,019 fine so when I press this and say home 2883 02:16:33,019 --> 02:16:36,718 and I give it a name called demo 2884 02:16:36,718 --> 02:16:41,218 and uh let's save backslash and let's 2885 02:16:41,218 --> 02:16:43,439 say backslash 2886 02:16:43,439 --> 02:16:46,920 but should I need a backslash itself 2887 02:16:46,920 --> 02:16:50,820 let's say let's see how it goes 2888 02:16:50,820 --> 02:16:53,840 50 degrees 2889 02:16:53,939 --> 02:16:57,359 refresh home demo 2890 02:16:57,359 --> 02:17:00,960 home demo 2891 02:17:01,200 --> 02:17:03,138 cool 2892 02:17:03,138 --> 02:17:08,459 okay increase salary home demo degree 2893 02:17:08,459 --> 02:17:09,540 salary 2894 02:17:09,540 --> 02:17:11,700 now again what it does 2895 02:17:11,700 --> 02:17:13,740 it does the same thing you could see 2896 02:17:13,740 --> 02:17:16,260 that my page is getting refreshed so 2897 02:17:16,260 --> 02:17:20,719 each time I change my pages completely 2898 02:17:26,040 --> 02:17:29,398 refresh I don't need this one I will do 2899 02:17:29,398 --> 02:17:33,420 something instead of giving a gear F now 2900 02:17:33,420 --> 02:17:36,359 I am going to use something called as 2901 02:17:36,359 --> 02:17:38,760 a router a link 2902 02:17:38,760 --> 02:17:40,978 so let LED be here let us just comment 2903 02:17:40,978 --> 02:17:43,799 it out and have something called 2904 02:17:43,799 --> 02:17:46,080 router link 2905 02:17:46,080 --> 02:17:49,160 and we have two 2906 02:17:49,160 --> 02:17:53,638 backslash and give a name home 2907 02:17:53,638 --> 02:17:56,879 let's just do it again one more time and 2908 02:17:56,879 --> 02:17:57,718 say 2909 02:17:57,718 --> 02:18:00,359 demo and give a name 2910 02:18:00,359 --> 02:18:01,920 demo 2911 02:18:01,920 --> 02:18:04,760 save this 2912 02:18:05,638 --> 02:18:10,260 home demo home demo increase salary home 2913 02:18:10,260 --> 02:18:12,679 demo 2914 02:18:13,200 --> 02:18:15,240 remote home demo you didn't notice the 2915 02:18:15,240 --> 02:18:17,099 tower this is not loading the page 2916 02:18:17,099 --> 02:18:21,599 itself what it does it is only uh it is 2917 02:18:21,599 --> 02:18:23,340 not loading the page but instead it is 2918 02:18:23,340 --> 02:18:27,660 uh changing the view alone like the page 2919 02:18:27,660 --> 02:18:29,519 along the component alone is Switched 2920 02:18:29,519 --> 02:18:31,978 but not the page itself is created again 2921 02:18:31,978 --> 02:18:35,539 how do we know that 2922 02:18:35,939 --> 02:18:38,218 you know are not going more technical 2923 02:18:38,218 --> 02:18:39,898 anymore like this is an introductory 2924 02:18:39,898 --> 02:18:43,080 video so the EA means that we are giving 2925 02:18:43,080 --> 02:18:45,179 a link to the browser we are telling the 2926 02:18:45,179 --> 02:18:47,519 browser to change it but using the 2927 02:18:47,519 --> 02:18:51,000 router link and just simply changing it 2928 02:18:51,000 --> 02:18:53,398 the page itself is not getting loaded up 2929 02:18:53,398 --> 02:18:55,679 so if you have some heavy dependencies 2930 02:18:55,679 --> 02:18:59,059 it will not be affected 2931 02:19:02,000 --> 02:19:05,280 maybe you want to wrap it around 2932 02:19:05,280 --> 02:19:08,479 something like this 2933 02:19:08,820 --> 02:19:12,840 I have a div and inside this I have 2934 02:19:12,840 --> 02:19:15,660 and this router view is no longer 2935 02:19:15,660 --> 02:19:17,700 so we are mounting it here 2936 02:19:17,700 --> 02:19:20,099 and uh 2937 02:19:20,099 --> 02:19:24,559 I have put one more div and say 2938 02:19:28,439 --> 02:19:32,820 H1 and call it as will come 2939 02:19:32,820 --> 02:19:35,299 uh let's um 2940 02:19:35,299 --> 02:19:37,939 let's learn oh 2941 02:19:37,939 --> 02:19:40,439 three pictures 2942 02:19:40,439 --> 02:19:43,138 and put uh 2943 02:19:43,138 --> 02:19:45,978 Style 2944 02:19:46,019 --> 02:19:47,760 background 2945 02:19:47,760 --> 02:19:50,280 color is white 2946 02:19:50,280 --> 02:19:52,500 or against 2947 02:19:52,500 --> 02:19:54,600 Greensboro 2948 02:19:54,600 --> 02:19:57,020 save 2949 02:19:57,800 --> 02:20:01,439 something like this and here 2950 02:20:01,439 --> 02:20:03,260 Style 2951 02:20:03,260 --> 02:20:06,620 color is 2952 02:20:07,140 --> 02:20:10,140 Gray 2953 02:20:13,380 --> 02:20:16,380 perfect and now this deal should not be 2954 02:20:16,380 --> 02:20:19,979 here it should be this remain div itself 2955 02:20:19,979 --> 02:20:23,939 should be having uh 2956 02:20:23,939 --> 02:20:26,460 should be on top somewhere above 2957 02:20:26,460 --> 02:20:29,100 everything and then we should have our 2958 02:20:29,100 --> 02:20:31,800 ID here because we are controlling the 2959 02:20:31,800 --> 02:20:34,680 body from somewhere in the CSS so go to 2960 02:20:34,680 --> 02:20:37,260 the body where we have we are saying it 2961 02:20:37,260 --> 02:20:39,359 is a display Flex a minimum width 2962 02:20:39,359 --> 02:20:41,660 maximum with Place item Center 2963 02:20:41,660 --> 02:20:47,340 okay go back to our 2964 02:20:47,340 --> 02:20:51,439 index and say 2965 02:20:52,500 --> 02:20:55,260 cut this out keep it on top 2966 02:20:55,260 --> 02:20:57,180 you cut this out 2967 02:20:57,180 --> 02:21:00,920 keep it here save 2968 02:21:01,460 --> 02:21:04,380 now it is one by one because it is a 2969 02:21:04,380 --> 02:21:06,600 flexor that's the reason why we have a 2970 02:21:06,600 --> 02:21:09,899 then one by one go to the CSS remove the 2971 02:21:09,899 --> 02:21:12,780 flux saw now this is no longer a flexor 2972 02:21:12,780 --> 02:21:16,080 so it will now come one by one and go 2973 02:21:16,080 --> 02:21:19,380 back to my app index this is no longer a 2974 02:21:19,380 --> 02:21:23,340 flex but still my position is going to 2975 02:21:23,340 --> 02:21:27,359 be absolute and uh I will have the same 2976 02:21:27,359 --> 02:21:30,780 concept as before uh 2977 02:21:30,780 --> 02:21:32,580 it will go to the top 2978 02:21:32,580 --> 02:21:36,479 and I will have a width of uh 100 2979 02:21:36,479 --> 02:21:39,899 percentage so that my this one goes to 2980 02:21:39,899 --> 02:21:42,380 the right 2981 02:21:42,960 --> 02:21:46,800 always and then Gainsborough is not 2982 02:21:46,800 --> 02:21:50,040 recognized let's do okay Gainsborough is 2983 02:21:50,040 --> 02:21:52,380 nice but just a lot of gray is not nice 2984 02:21:52,380 --> 02:21:55,580 to give blood pressure 2985 02:21:57,120 --> 02:22:02,300 okay and uh let's uh fix the height 2986 02:22:02,300 --> 02:22:05,720 that uh 2987 02:22:07,140 --> 02:22:08,899 forum 2988 02:22:08,899 --> 02:22:12,800 let's see how it looks 2989 02:22:13,680 --> 02:22:16,800 oh yeah it doesn't look good height is 2990 02:22:16,800 --> 02:22:20,040 fixed but this uh content itself is not 2991 02:22:20,040 --> 02:22:22,260 filter 2992 02:22:22,260 --> 02:22:24,920 so the content is rolling out here now 2993 02:22:24,920 --> 02:22:28,500 and why am I playing with all these 2994 02:22:28,500 --> 02:22:30,620 things 2995 02:22:30,840 --> 02:22:35,700 uh let's say this color is fine and 2996 02:22:35,700 --> 02:22:38,399 let's give again 2997 02:22:38,399 --> 02:22:43,080 uh font size of 2998 02:22:43,080 --> 02:22:45,080 um 2999 02:22:45,960 --> 02:22:49,460 30 pixels 3000 02:22:50,520 --> 02:22:54,120 okay and then this one will be floating 3001 02:22:54,120 --> 02:22:56,340 and uh 3002 02:22:56,340 --> 02:22:58,800 position is 3003 02:22:58,800 --> 02:23:01,859 sorry float writer float on the right 3004 02:23:01,859 --> 02:23:03,300 side 3005 02:23:03,300 --> 02:23:06,000 so it will go to the right side 3006 02:23:06,000 --> 02:23:08,880 let's learn View 3.js and this one is 3007 02:23:08,880 --> 02:23:10,680 fine let's go back to our application 3008 02:23:10,680 --> 02:23:15,660 now and uh where is where is it where is 3009 02:23:15,660 --> 02:23:18,899 so here now you have the link why did I 3010 02:23:18,899 --> 02:23:19,859 do this 3011 02:23:19,859 --> 02:23:22,620 I remembered why this 3012 02:23:22,620 --> 02:23:25,640 sometimes like 3013 02:23:25,800 --> 02:23:28,439 lose track of what I'm doing now let's 3014 02:23:28,439 --> 02:23:31,439 refresh we'll have a 3015 02:23:31,439 --> 02:23:33,920 hello 3016 02:23:33,960 --> 02:23:36,680 the drinks 3017 02:23:37,080 --> 02:23:39,540 now what happens here when I press the 3018 02:23:39,540 --> 02:23:42,060 demo just see what happens the whole 3019 02:23:42,060 --> 02:23:44,160 page is loaded even this let's view its 3020 02:23:44,160 --> 02:23:46,580 loaded up 3021 02:23:46,680 --> 02:23:48,479 the whole page is refreshed you could 3022 02:23:48,479 --> 02:23:51,359 see that for a splits again this is 3023 02:23:51,359 --> 02:23:52,979 getting loaded and then it is getting 3024 02:23:52,979 --> 02:23:57,800 applied now if I change this 3025 02:23:58,200 --> 02:24:00,600 to like this and 3026 02:24:00,600 --> 02:24:05,840 press this one save refresh first 3027 02:24:05,880 --> 02:24:08,280 let's load one more refresh 3028 02:24:08,280 --> 02:24:11,819 okay now when I change to demo you could 3029 02:24:11,819 --> 02:24:14,220 see that only the component which is 3030 02:24:14,220 --> 02:24:16,740 inside is getting rendered now are like 3031 02:24:16,740 --> 02:24:18,660 moved to one item to another 3032 02:24:18,660 --> 02:24:20,520 the other way around the whole page is 3033 02:24:20,520 --> 02:24:22,680 not getting louder that's the main idea 3034 02:24:22,680 --> 02:24:25,200 behind the using a router link instead 3035 02:24:25,200 --> 02:24:28,920 of a means that you are instructing the 3036 02:24:28,920 --> 02:24:32,340 address bar to change it and ask the 3037 02:24:32,340 --> 02:24:34,380 browser to reload it but router link 3038 02:24:34,380 --> 02:24:37,380 means that you are just telling the 3039 02:24:37,380 --> 02:24:40,439 component view to change the link page 3040 02:24:40,439 --> 02:24:43,200 from one page to another that's all fine 3041 02:24:43,200 --> 02:24:46,880 you can assign it 3042 02:24:49,979 --> 02:24:52,260 eraser what if you give something that 3043 02:24:52,260 --> 02:24:54,180 is not present 3044 02:24:54,180 --> 02:24:55,979 and something is not present it will 3045 02:24:55,979 --> 02:24:57,540 just say that it is not present that's 3046 02:24:57,540 --> 02:25:00,120 it quite simple but we need to show to 3047 02:25:00,120 --> 02:25:01,380 the users 3048 02:25:01,380 --> 02:25:05,060 this is not present data so to do that 3049 02:25:05,060 --> 02:25:08,040 go to your routes 3050 02:25:08,040 --> 02:25:11,100 now this one just bear with me because 3051 02:25:11,100 --> 02:25:14,040 it might look a little confusing now 3052 02:25:14,040 --> 02:25:16,280 we are going to use something called as 3053 02:25:16,280 --> 02:25:18,840 path matching 3054 02:25:18,840 --> 02:25:22,500 why do I use it and uh where do I use it 3055 02:25:22,500 --> 02:25:26,100 first thing uh just you know this is an 3056 02:25:26,100 --> 02:25:29,040 inbuilt or default of blue Js 3057 02:25:29,040 --> 02:25:33,000 way so I just say that I have a 3058 02:25:33,000 --> 02:25:35,819 uh what's called 3059 02:25:35,819 --> 02:25:40,319 anything so let's say auth match I 3060 02:25:40,319 --> 02:25:41,460 believe 3061 02:25:41,460 --> 02:25:44,340 I'm not able to find it but obviously it 3062 02:25:44,340 --> 02:25:48,720 is a path match so how do I know that 3063 02:25:48,720 --> 02:25:50,880 because I have 3064 02:25:50,880 --> 02:25:54,020 already seen it and uh 3065 02:25:55,020 --> 02:25:57,240 okay so what I'm saying is that the 3066 02:25:57,240 --> 02:26:00,680 whatever is after the 3067 02:26:00,680 --> 02:26:03,120 backslasher so it's basically 3068 02:26:03,120 --> 02:26:04,740 regular expression 3069 02:26:04,740 --> 02:26:08,359 whatever matches anything then 3070 02:26:08,359 --> 02:26:10,920 this is what we say 3071 02:26:10,920 --> 02:26:14,300 not found 3072 02:26:14,640 --> 02:26:16,319 not found 3073 02:26:16,319 --> 02:26:19,140 and the component you need to give a 3074 02:26:19,140 --> 02:26:21,300 component call you you need a component 3075 02:26:21,300 --> 02:26:23,880 to display So currently we don't need to 3076 02:26:23,880 --> 02:26:26,340 export or import a component we are 3077 02:26:26,340 --> 02:26:28,800 going to keep it very simple I am going 3078 02:26:28,800 --> 02:26:31,100 to create a component called 3079 02:26:31,100 --> 02:26:34,560 not found the component which will be an 3080 02:26:34,560 --> 02:26:37,740 inline JavaScript like view component 3081 02:26:37,740 --> 02:26:39,359 inline component 3082 02:26:39,359 --> 02:26:42,660 how do I do that not found a comp is 3083 02:26:42,660 --> 02:26:43,760 equal to 3084 02:26:43,760 --> 02:26:46,680 whatever you will put inside out so 3085 02:26:46,680 --> 02:26:48,359 whatever you will put inside you just 3086 02:26:48,359 --> 02:26:51,300 put it inside a curly basis and just 3087 02:26:51,300 --> 02:26:53,819 Define it there so whatever you have 3088 02:26:53,819 --> 02:26:55,920 like template you have script you have a 3089 02:26:55,920 --> 02:26:58,319 style you have so many other things but 3090 02:26:58,319 --> 02:26:59,460 we are not going to focus 3091 02:26:59,460 --> 02:27:01,560 on this we're just going to say very 3092 02:27:01,560 --> 02:27:05,220 simple uh we have like template 3093 02:27:05,220 --> 02:27:06,660 okay 3094 02:27:06,660 --> 02:27:10,640 and the template will be 3095 02:27:10,680 --> 02:27:14,359 a new item data 3096 02:27:18,600 --> 02:27:21,740 so what is the temperature 3097 02:27:22,260 --> 02:27:24,060 and let's say 3098 02:27:24,060 --> 02:27:26,340 do 3099 02:27:26,340 --> 02:27:29,479 why is it not working 3100 02:27:34,439 --> 02:27:38,160 am I doing some mistake 3101 02:27:38,160 --> 02:27:40,760 foreign 3102 02:27:43,870 --> 02:27:46,939 [Music] 3103 02:27:50,640 --> 02:27:53,359 probably 3104 02:27:55,979 --> 02:27:58,020 let's say 3105 02:27:58,020 --> 02:28:00,439 oh 3106 02:28:02,000 --> 02:28:07,640 it's not able to identify the space so 3107 02:28:07,740 --> 02:28:09,020 ready 3108 02:28:09,020 --> 02:28:14,819 let's just have a H2 just say that 3109 02:28:14,819 --> 02:28:16,800 now in reality 3110 02:28:16,800 --> 02:28:18,500 reflection what you would usually do 3111 02:28:18,500 --> 02:28:22,140 what I usually do is I will go here not 3112 02:28:22,140 --> 02:28:26,340 found a templates CSS I'll just try to 3113 02:28:26,340 --> 02:28:29,040 download like thousands of 3114 02:28:29,040 --> 02:28:31,560 templates 3115 02:28:31,560 --> 02:28:35,640 not found page not founded with there is 3116 02:28:35,640 --> 02:28:38,300 not form templates CSS there are several 3117 02:28:38,300 --> 02:28:41,100 templates available I will just take 3118 02:28:41,100 --> 02:28:44,280 whatever I find this interesting and I 3119 02:28:44,280 --> 02:28:46,800 will just open the code 3120 02:28:46,800 --> 02:28:49,800 and copy the HTML copy the CSS I always 3121 02:28:49,800 --> 02:28:52,319 try to stick to keeping something very 3122 02:28:52,319 --> 02:28:55,200 simple no JavaScript only the CSS and 3123 02:28:55,200 --> 02:28:59,399 only the values here that currently let 3124 02:28:59,399 --> 02:29:02,819 us not go there that that way we will 3125 02:29:02,819 --> 02:29:05,220 keep it like this I'm just saying that 3126 02:29:05,220 --> 02:29:08,280 the page not found straight forward page 3127 02:29:08,280 --> 02:29:12,420 not found and uh not phone component 3128 02:29:12,420 --> 02:29:14,100 whenever the page is not from display 3129 02:29:14,100 --> 02:29:16,080 the not form component 3130 02:29:16,080 --> 02:29:18,920 save this 3131 02:29:20,220 --> 02:29:23,220 it has another error component template 3132 02:29:23,220 --> 02:29:27,060 option but runtime is not supported 3133 02:29:27,060 --> 02:29:30,540 in this build of you configure your 3134 02:29:30,540 --> 02:29:34,500 bundler to his view to aha okay in this 3135 02:29:34,500 --> 02:29:37,200 Builder it is not able to access the 3136 02:29:37,200 --> 02:29:40,620 template only when you are using Direct 3137 02:29:40,620 --> 02:29:42,479 and JavaScript you are able to do this 3138 02:29:42,479 --> 02:29:43,859 perfect 3139 02:29:43,859 --> 02:29:46,080 no one wants you to be a 3140 02:29:46,080 --> 02:29:48,780 straightforward thing so let's say let's 3141 02:29:48,780 --> 02:29:51,620 create new file and say 3142 02:29:51,620 --> 02:29:53,580 not 3143 02:29:53,580 --> 02:29:55,140 found 3144 02:29:55,140 --> 02:29:56,880 is not wrong 3145 02:29:56,880 --> 02:29:59,939 page not found 3146 02:29:59,939 --> 02:30:03,359 and we are looking into this template 3147 02:30:03,359 --> 02:30:07,380 right like The View 3148 02:30:08,340 --> 02:30:11,520 I showed uh for for some reason I 3149 02:30:11,520 --> 02:30:13,560 remember there is a snippet 3150 02:30:13,560 --> 02:30:16,140 so this is an extension so let's go to 3151 02:30:16,140 --> 02:30:17,880 the extension 3152 02:30:17,880 --> 02:30:19,460 view 3153 02:30:19,460 --> 02:30:22,700 Snappers Maybe 3154 02:30:25,500 --> 02:30:28,140 ah sorry that's not this one 3155 02:30:28,140 --> 02:30:31,020 this has a we already have it then why 3156 02:30:31,020 --> 02:30:33,500 am I not have to see it though 3157 02:30:33,500 --> 02:30:37,020 they have some examples how to lose it 3158 02:30:37,020 --> 02:30:39,420 totally forgotten 3159 02:30:39,420 --> 02:30:43,140 we base vvv 3160 02:30:43,140 --> 02:30:45,840 E-class so they have something called V 3161 02:30:45,840 --> 02:30:49,500 base 3 setup okay let's use it 3162 02:30:49,500 --> 02:30:52,560 V base 3 setup 3163 02:30:52,560 --> 02:30:54,420 so where is the file that we created 3164 02:30:54,420 --> 02:30:57,300 it's there in not page not found 3165 02:30:57,300 --> 02:31:00,180 and uh 3166 02:31:00,180 --> 02:31:02,100 Ctrl V 3167 02:31:02,100 --> 02:31:05,100 base 3168 02:31:06,500 --> 02:31:10,939 very weird it's not working 3169 02:31:11,399 --> 02:31:14,280 anyhow 3170 02:31:14,280 --> 02:31:16,500 is it because I did not give it a name 3171 02:31:16,500 --> 02:31:17,780 okay 3172 02:31:17,780 --> 02:31:20,819 because I did not give it a real name I 3173 02:31:20,819 --> 02:31:24,060 just gave you this path so do you let's 3174 02:31:24,060 --> 02:31:27,960 try now V base of three okay press tab 3175 02:31:27,960 --> 02:31:31,920 I got a language scoped 3176 02:31:31,920 --> 02:31:36,180 and setup blah blah blah see this is the 3177 02:31:36,180 --> 02:31:39,720 difference in our demo we saw like um in 3178 02:31:39,720 --> 02:31:41,760 the script we are directly calling the 3179 02:31:41,760 --> 02:31:42,899 setup 3180 02:31:42,899 --> 02:31:45,300 uh but there is one more way which is to 3181 02:31:45,300 --> 02:31:47,280 export and set up here you need to 3182 02:31:47,280 --> 02:31:48,840 return when you are having a constant 3183 02:31:48,840 --> 02:31:50,340 when you're having a property method 3184 02:31:50,340 --> 02:31:52,620 whatever it is you need to export it to 3185 02:31:52,620 --> 02:31:56,819 avoid all those issues like uh you know 3186 02:31:56,819 --> 02:31:59,100 you directly remove like this that's it 3187 02:31:59,100 --> 02:32:01,020 so it will remove everything you can 3188 02:32:01,020 --> 02:32:02,220 directly have it 3189 02:32:02,220 --> 02:32:05,399 lying is equal to TS okay we're not 3190 02:32:05,399 --> 02:32:07,800 going to do its script instead as of now 3191 02:32:07,800 --> 02:32:10,920 but here let's say 3192 02:32:10,920 --> 02:32:12,720 H2 3193 02:32:12,720 --> 02:32:15,660 page not found 3194 02:32:15,660 --> 02:32:17,819 this is fine this is coming from page 3195 02:32:17,819 --> 02:32:19,920 not found View and go back to my route 3196 02:32:19,920 --> 02:32:24,080 and uh just like this I'm going to call 3197 02:32:24,080 --> 02:32:26,720 pitch not fun 3198 02:32:26,720 --> 02:32:31,260 this is called page not 3199 02:32:31,260 --> 02:32:32,520 found 3200 02:32:32,520 --> 02:32:36,120 and the imported PNF there is a problem 3201 02:32:36,120 --> 02:32:38,160 we are not able to find something so 3202 02:32:38,160 --> 02:32:41,220 imported PNF is this and template is 3203 02:32:41,220 --> 02:32:43,859 removed save 3204 02:32:43,859 --> 02:32:45,899 so it should now show me page not found 3205 02:32:45,899 --> 02:32:48,479 and uh for some weird reason it is going 3206 02:32:48,479 --> 02:32:51,479 up uh maybe not for some weird reason 3207 02:32:51,479 --> 02:32:54,120 maybe the way how we have set it up 3208 02:32:54,120 --> 02:32:57,960 go back here and this div is here this 3209 02:32:57,960 --> 02:33:01,700 div is here and uh 3210 02:33:01,700 --> 02:33:06,140 let's put them both inside Wonder 3211 02:33:06,840 --> 02:33:09,800 so 3212 02:33:10,819 --> 02:33:14,280 and I will do one thing instead of 3213 02:33:14,280 --> 02:33:16,979 observing I will say sticky 3214 02:33:16,979 --> 02:33:19,760 save it 3215 02:33:20,580 --> 02:33:23,000 cool 3216 02:33:24,060 --> 02:33:27,359 V so the page not found here when I go 3217 02:33:27,359 --> 02:33:31,220 to home I am having home 3218 02:33:31,979 --> 02:33:35,160 when I go to demo I have demo home demo 3219 02:33:35,160 --> 02:33:37,620 and we will have one more link now which 3220 02:33:37,620 --> 02:33:41,040 will say this is completely 3221 02:33:41,040 --> 02:33:43,260 so we will which will redirect us to 3222 02:33:43,260 --> 02:33:47,280 completely on unavailable value and this 3223 02:33:47,280 --> 02:33:48,780 is happening where is this happening 3224 02:33:48,780 --> 02:33:50,939 this is happening in Apple so another 3225 02:33:50,939 --> 02:33:52,620 link 3226 02:33:52,620 --> 02:33:57,060 with uh some arbitrary value and say 3227 02:33:57,060 --> 02:33:59,520 dummy 3228 02:33:59,520 --> 02:34:03,300 and let's put some space 3229 02:34:03,300 --> 02:34:05,939 you know you should not be doing like 3230 02:34:05,939 --> 02:34:07,920 this you should be adding some CSS to 3231 02:34:07,920 --> 02:34:10,200 handle it but that's okay when you try 3232 02:34:10,200 --> 02:34:12,420 dummy the page is not phone because if 3233 02:34:12,420 --> 02:34:14,040 you could see in the top of this page is 3234 02:34:14,040 --> 02:34:16,740 not found demo is found home is found by 3235 02:34:16,740 --> 02:34:19,319 dummy is not found 3236 02:34:19,319 --> 02:34:21,600 very straightforward right so that's the 3237 02:34:21,600 --> 02:34:24,960 way how you route it inside your app you 3238 02:34:24,960 --> 02:34:27,180 load your router View and provide some 3239 02:34:27,180 --> 02:34:29,520 different links somewhere this is not 3240 02:34:29,520 --> 02:34:31,560 the only way you can think of 3241 02:34:31,560 --> 02:34:34,439 creating another component maybe a 3242 02:34:34,439 --> 02:34:36,840 separate component called as a sidebar 3243 02:34:36,840 --> 02:34:39,000 component or navigation bar component 3244 02:34:39,000 --> 02:34:41,399 itself create a new view component 3245 02:34:41,399 --> 02:34:44,280 called navigation bar now design it very 3246 02:34:44,280 --> 02:34:46,800 nicely and then load that component here 3247 02:34:46,800 --> 02:34:48,960 so one component as a sidebar component 3248 02:34:48,960 --> 02:34:50,520 and then you have a router component 3249 02:34:50,520 --> 02:34:52,920 when you press that you directly ask 3250 02:34:52,920 --> 02:34:57,000 your view JS to change the route 3251 02:34:57,000 --> 02:35:00,899 so that's it we have now seen some of 3252 02:35:00,899 --> 02:35:03,479 the basic introductions interview JS how 3253 02:35:03,479 --> 02:35:07,580 we can deal with router the thing is 3254 02:35:07,580 --> 02:35:10,800 this is not the complete one or actually 3255 02:35:10,800 --> 02:35:13,439 I have so many so many things still 3256 02:35:13,439 --> 02:35:16,620 pending uh you can have a rendering 3257 02:35:16,620 --> 02:35:19,439 based on a list you have the Far East 3258 02:35:19,439 --> 02:35:21,780 rendering you have that two-way binding 3259 02:35:21,780 --> 02:35:25,680 you have uh fetching the element itself 3260 02:35:25,680 --> 02:35:28,020 using the template rough and much more 3261 02:35:28,020 --> 02:35:31,080 are there but this video was only to 3262 02:35:31,080 --> 02:35:34,620 give a basic introduction about how VJs 3263 02:35:34,620 --> 02:35:37,439 component API composition apis 3264 02:35:37,439 --> 02:35:40,620 I will prepare or see you all in another 3265 02:35:40,620 --> 02:35:43,859 video a detailed one where we will try 3266 02:35:43,859 --> 02:35:47,100 to build everything from scratcher 3267 02:35:47,100 --> 02:35:49,680 so thank you for watching so far I hope 3268 02:35:49,680 --> 02:35:52,260 you got at least some basic idea about 3269 02:35:52,260 --> 02:35:55,580 V3 thank you 218495

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.