All language subtitles for 002 Options API - Data & Methods_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
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 Download
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: WEBVTT 00:01.000 --> 00:05.500 Let's set up some data and methods to get this up working using the options API. 00:05.590 --> 00:12.860 So we need to add a script section and inside that we need to add our export defaults. 00:14.770 --> 00:17.530 Let's set up our data first for this counter. 00:18.370 --> 00:26.080 So we need to add a data method which returns an object and we could pull all of our data properties 00:26.080 --> 00:26.560 in here. 00:26.650 --> 00:30.220 So a lot of property called counts are set up to zero. 00:30.490 --> 00:33.460 Save that and we should be able to use that in our template now. 00:34.000 --> 00:40.150 So we'll get rid of this zero, add double curly braces and we'll just put counter in here and save 00:40.150 --> 00:40.480 that. 00:40.750 --> 00:44.890 And if I change this now, we should see it update in the template which we do. 00:45.520 --> 00:47.110 I'll set that back to zero. 00:48.010 --> 00:52.030 And now let's set up some methods for increasing and decreasing this counter. 00:52.060 --> 00:55.810 So I'm going to click convert to this button, this plus button. 00:56.050 --> 01:01.300 So I'll click because we'll find a method called increase counter. 01:01.990 --> 01:03.070 Let's create this method. 01:03.220 --> 01:09.520 So after our data method, a lot of comma and we need to add our methods object and we'll create this 01:09.520 --> 01:16.810 method increase counter and all we want to do is increase this counter property by one. 01:16.840 --> 01:22.930 So to access our data properties we can just do this dot and then counter and we can just do plus plus 01:22.930 --> 01:24.250 to increase it by one. 01:24.370 --> 01:27.310 I'll save that and let's see if that's working yet. 01:27.310 --> 01:28.480 We can increase the counter. 01:29.260 --> 01:32.020 So now we just need a method to decrease the counter. 01:32.020 --> 01:38.740 So a lot of comma here and I'll duplicate this method, rename it to decrease counter. 01:39.040 --> 01:44.890 Just change the code to this account to minus minus to decrease this counter property. 01:44.890 --> 01:51.220 And then I'll copy this click handler from the plus button and add it to the minus button. 01:51.220 --> 01:57.240 I'll just change the method name to decrease counter and save that we can now increase or decrease our 01:57.280 --> 01:57.850 counter.2479

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