All language subtitles for 5. Navigating with RouterLink

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic Download
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
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
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:01,110 --> 00:00:06,210 Now that we understand the purpose of this router outlet thing right here we can start to add in a navigation 2 00:00:06,210 --> 00:00:07,080 bar. 3 00:00:07,080 --> 00:00:11,790 And the reason that I am talking about adding in a navigation bar right now is well pretty much we always 4 00:00:11,790 --> 00:00:14,060 want to show this navigation bar at the top. 5 00:00:14,250 --> 00:00:18,690 Then underneath it depending upon the current route you want to show some different components and angular 6 00:00:18,690 --> 00:00:21,610 is going to take care of all that stuff automatically. 7 00:00:21,700 --> 00:00:26,300 You and I can add in a navigation bar that will be visible at all times. 8 00:00:26,310 --> 00:00:32,940 We just write in a little bit of markup directly above that router outlet but can remove the two divs 9 00:00:33,120 --> 00:00:39,180 we currently have inside of here and then we'll replace this one on top with how about an anchor tag 10 00:00:39,780 --> 00:00:43,880 that has an 8 ref do slash elements 11 00:00:46,950 --> 00:00:51,510 inside there I'll give it the text elements then I'll duplicate that on the second one I'll add in a 12 00:00:51,510 --> 00:00:56,820 trough of collections and I'll give it the text collections. 13 00:00:56,960 --> 00:00:59,700 Now we save that look back over. 14 00:00:59,780 --> 00:01:01,490 We've got the elements link right here. 15 00:01:01,490 --> 00:01:05,780 When I click it I go to the elements root and I got collections right here. 16 00:01:05,810 --> 00:01:10,610 Now I've got some persistent content at the very top of the screen and the actual component that is 17 00:01:10,610 --> 00:01:16,070 visible is going to be changing automatically depending upon the current route back and forth back and 18 00:01:16,070 --> 00:01:19,310 forth. 19 00:01:19,330 --> 00:01:23,420 Now there's just one little issue right now with those two anchor tags we just added in. 20 00:01:23,680 --> 00:01:29,400 I want you to open up your chrome console and navigate to the Network tab on their once you get to the 21 00:01:29,400 --> 00:01:30,090 Network tab. 22 00:01:30,090 --> 00:01:35,660 Make sure that you are filtering by all take a look at what happens whenever I click on one of these 23 00:01:35,660 --> 00:01:41,480 two links right here and click on say elements and as soon as I do I'll notice that all of these different 24 00:01:41,480 --> 00:01:47,240 requests for the JavaScript files on my application have been repeated over to collections and I see 25 00:01:47,240 --> 00:01:53,300 that they all get issued once again right now whenever a user navigates using these plane anchor tags 26 00:01:53,630 --> 00:02:00,290 they're essentially doing a total refresh of our application that is not what we want inside of an angular 27 00:02:00,290 --> 00:02:01,160 app. 28 00:02:01,160 --> 00:02:09,020 Instead whenever a user navigates around we want to a transparently change the URL but not do an entire 29 00:02:09,020 --> 00:02:10,750 refresh of the page. 30 00:02:10,760 --> 00:02:17,150 Let me show you how we can do that and you'll see the impact right away back inside of my template file 31 00:02:17,900 --> 00:02:21,120 I'm going to find those two H rough attributes we added. 32 00:02:21,200 --> 00:02:30,050 I'm going to change both them to instead say router link and router link like so I'll then save this 33 00:02:30,720 --> 00:02:32,320 to flip back over. 34 00:02:32,350 --> 00:02:35,110 Now take a look at what happens when I click on these two links. 35 00:02:35,240 --> 00:02:41,180 I'm going to click on say elements and the content on the screen changes instantly but I'm not making 36 00:02:41,270 --> 00:02:44,030 any additional requests to my development server. 37 00:02:44,030 --> 00:02:48,480 So what's going on here whenever we want to navigate a user around our application. 38 00:02:48,480 --> 00:02:54,930 We're going to use this router link attributes the router link attribute talks directly to the router 39 00:02:54,990 --> 00:03:00,060 inside of our application router is what decides what content to show in the screen depending upon or 40 00:03:00,060 --> 00:03:06,240 based upon the current you are L and we add on this router link attribute that tells angular that whenever 41 00:03:06,240 --> 00:03:12,280 user clicks on this anchor tag we want to navigate over to slash elements or slash collections. 42 00:03:12,320 --> 00:03:18,660 We want to do so without completely refreshing the page but angular will automatically update the URL 43 00:03:18,960 --> 00:03:24,930 but not issue an entire new browser request that you are url instead angular is just going to update 44 00:03:24,930 --> 00:03:30,960 the URL and then automatically on the same page without any refresh whatsoever decide upon what content 45 00:03:30,960 --> 00:03:32,670 to show instead. 46 00:03:32,710 --> 00:03:38,780 So we prefer to use this router link attribute wherever possible that a user doesn't have to reload 47 00:03:38,780 --> 00:03:40,180 the entire application. 48 00:03:40,400 --> 00:03:46,340 Instead they just reach change or just change the content that's on the screen without re downloading 49 00:03:46,430 --> 00:03:50,370 all these different JavaScript files the big takeaway here. 50 00:03:50,490 --> 00:03:55,170 As soon as we start using angular and we want to navigate a user around we're going to use this router 51 00:03:55,170 --> 00:04:00,770 link attribute instead of the classic trap that you might be used to. 52 00:04:00,790 --> 00:04:01,090 All right. 53 00:04:01,120 --> 00:04:06,250 Now that we've seen the router link and we've got some semblance of a little header right here a little 54 00:04:06,250 --> 00:04:07,420 bit of navigation stuff. 55 00:04:07,780 --> 00:04:08,970 Let's take a quick pause right here. 56 00:04:08,980 --> 00:04:13,420 When come back the next video we're gonna add in a little bit better styling to this thing that it actually 57 00:04:13,420 --> 00:04:16,840 looks like a proper navigation bar like what you see right there. 6392

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