All language subtitles for 003 Reactive Objects_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
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

Original subtitles

We can see that refs are handy for storing simple independent items of data such as a number or a string,

or maybe an array or a boolean.

But what if we want to store a bunch of different data that's related together in a single object,

a bit like we did with the data method in Options API?

Well, we can do that with a reactive object.

So let's say we want to store a counter about counter title together in a single object.

Since this data is related, then we can do that with a reactive object.

So to set up a reactive objects, we can create a const or we can use a variable and we give that name

so we could call that counter data and we set that equal to the reactive method.

We do need to import this from view.

So we can just add that to our import object here reactive and we can just pass an object into this

reactive method.

Now we can place all of our data properties in here.

So let's create a property called count for our count to give that an initial value of zero.

And then without a property called title for the title, I will set that to my counter.

Save that.

Let's use the data from this reactive object in our template instead of the data from these refs.

So if we want to use the counter that's in this reactive objects here, we can just do counter data

dot count.

And if we want to use the title, it's in the reactive objects.

And we can just change this in this heading type to counter data dot title.

Let's update this V model as well to use this reactive object.

So I'll set this V model to counter data, Dot's title and I'll save that and reload.

Let's see if our title sucks up.

Okay.

Yeah.

That's still working on the two way data binding.

Still working as well on a counter is working.

We could see zero displayed there.

And if I change the value of counter data accounts, we can see it.

Update.

However, these buttons are not working and that's because these methods, the increase counter method

and the decrease counter method are still manipulating this ref and not this count that's in our active

object.

So let's update these methods.

So instead of counter dot value plus plus, we can just two counts of data, dot counts, plus plus.

And then in the decrease counter method, we can just do counter data dot count, minus, minus.

Note that we don't need to use dot value when we're using data that's in reactive objects.

We just use the straight property name counter data accounts.

Now let's say that and see if these buttons are working.

And yet that's working again now.

Okay.

So we're no longer using these refs anymore.

Our base coach shows us that by graying these out a little bit.

So let's just comment these out.

And since we no longer using this method from view, we can remove that from this import statement like.

So save the.

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