All language subtitles for 019 Aliases_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

In this lecture, we're going to add an alias for our stage properties.

Aliases can be a great way to rename state properties for a component with dozens of properties and

methods.

There are two problems you may come across when working with large components.

First, you may have properties with conflicting names.

Secondly, the names from the store may not be descriptive enough for a component.

For example, let's look at the properties name from the modal store.

It's called is open.

This name isn't very descriptive.

What if we had a dropdown that's tolerable?

Does this property affect the modal or dropdown?

We wouldn't know by looking at the property.

For these reasons you can try renaming the property.

However, renaming a state property from the store may not always be practical.

If your state property is being used across several components, those components would need to be updated.

Rather than going on a wild goose chase, you can rename a state property from within a component by

using an alias.

Let's look at an example.

In the off component we should rename the is open state property.

Previously we mapped the state into the component by using the map writable state function.

The second argument accepts an array of state properties to map.

Let's replace this argument with an object.

Inside this object, the property name will represent the name of the state property.

Let's rename the is open property to modal visibility.

Next, the value should reference the name of the state property to rename let's set this property to

is open.

By using an alias.

We do not need to modify the store, nor do we need to update components outside of the OP component.

Only the OP component is affected by the renaming.

We're not finished yet.

Scroll to the close button on this button.

Change the expression to use the modal visibility alias.

We can continue using the state property as we did before.

Peneha is smart enough to update the appropriate state property from the store.

Let's visit the browser one last time to check if everything is functioning.

Open and close the modal.

The modal will toggle its appearance without a problem.

Technically, we don't have a property called modal visibility in our state.

Regardless, we can still use an alias.

This alias can be useful in case you have conflicting names in your application or you would like to

shorten things of it.

For this course we won't need to use them.

Switching back to the editor.

Let's continue moving forward.

The modal is completely toggle able.

The last step is to work on the tabs in the modal.

At the moment both forms are appearing.

We should toggle the visibility of both forms based on the tabs.

We'll tackle this step in the next lecture.

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