All language subtitles for 6. Handling User Input

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,350 --> 00:00:06,510 Let's add in some code to make sure that we detect whenever user types inside that text input to do 2 00:00:06,510 --> 00:00:06,850 so. 3 00:00:06,870 --> 00:00:09,780 We're going to go back into our component template. 4 00:00:09,780 --> 00:00:12,840 That's our app component that HDMI file inside of here. 5 00:00:12,840 --> 00:00:18,350 We're going to find our input element and then on that element we're going to add an event binding. 6 00:00:18,660 --> 00:00:23,180 Remember we specify an event binding with parentheses inside the parentheses. 7 00:00:23,190 --> 00:00:26,050 We list out the event that we want to watch for. 8 00:00:26,090 --> 00:00:31,020 So in this case you want to watch for an input event which is triggered whenever user changes anything 9 00:00:31,020 --> 00:00:40,550 inside this input and whenever that occurs we will try calling a method called on input on our class. 10 00:00:40,600 --> 00:00:44,980 Remember that when we call on inputs or whatever method we call right here we probably want to communicate 11 00:00:44,980 --> 00:00:47,640 whatever user just entered into that text input. 12 00:00:47,810 --> 00:00:53,840 But to do so we need to refer to that event that target dot value property we can get access to the 13 00:00:53,840 --> 00:01:00,140 event object that is created whenever a user causes the input event by writing out dollar sign event 14 00:01:00,980 --> 00:01:05,660 and then on there we'll get the target which is a reference to the input element and then off there 15 00:01:06,020 --> 00:01:13,400 we'll get our value like so now you'll notice that this is all underlined inside red as because we don't 16 00:01:13,400 --> 00:01:17,410 have a method on our component class called on input. 17 00:01:17,450 --> 00:01:24,100 Let's go back over to our app computer right now and add that in over inside of app component. 18 00:01:24,120 --> 00:01:24,680 Yes. 19 00:01:24,780 --> 00:01:31,680 After we declare our random text will then add in the on input method this will be called with some 20 00:01:31,680 --> 00:01:38,390 value and we have to annotate its type as being a string then inside of here if we really want to follow 21 00:01:38,390 --> 00:01:44,150 the directions we want to make sure that we console log whatever that value is so inside that event 22 00:01:44,150 --> 00:01:55,290 handler will do a console log of value let's save this will float back over and test it out and get 23 00:01:55,410 --> 00:01:55,970 over here. 24 00:01:56,030 --> 00:02:01,460 I'm going to open up my console inside my browser and then I'll select the input and start typing messages 25 00:02:01,520 --> 00:02:07,160 as I do so I see the value inside the input with every single key press it looks like that worked out 26 00:02:07,160 --> 00:02:09,000 pretty well. 27 00:02:09,030 --> 00:02:12,030 All right let's now move on to our next step in this step. 28 00:02:12,030 --> 00:02:14,760 We're not going to do the character comparison right away. 29 00:02:14,760 --> 00:02:19,340 Instead we're going to start to handle that success message at the bottom of our application. 30 00:02:19,440 --> 00:02:24,800 This one right here right now that success message is always visible. 31 00:02:24,800 --> 00:02:27,600 I want you to make sure that the message gets hidden by default. 32 00:02:27,620 --> 00:02:34,520 When our application first starts up and then as soon as the user enters the exact correct text we're 33 00:02:34,520 --> 00:02:37,040 then going to show success on the screen. 34 00:02:37,040 --> 00:02:43,430 So after that we do want to in fact show that element right there go ahead and give that a shot. 35 00:02:43,470 --> 00:02:46,680 We'll take a quick pause right here and go over a solution in just a moment. 3982

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