All language subtitles for 14. Displaying the Funds
Afrikaans
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bengali
Bosnian
Bulgarian
Catalan
Cebuano
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Filipino
Finnish
French
Frisian
Galician
Georgian
German
Greek
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Khmer
Korean
Kurdish (Kurmanji)
Kyrgyz
Lao
Latin
Latvian
Lithuanian
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mongolian
Myanmar (Burmese)
Nepali
Norwegian
Pashto
Persian
Polish
Portuguese
Punjabi
Romanian
Russian
Samoan
Scots Gaelic
Serbian
Sesotho
Shona
Sindhi
Sinhala
Slovak
Slovenian
Somali
Spanish
Sundanese
Swahili
Swedish
Tajik
Tamil
Telugu
Thai
Turkish
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Xhosa
Yiddish
Yoruba
Zulu
Odia (Oriya)
Kinyarwanda
Turkmen
Tatar
Uyghur
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,650 --> 00:00:06,060
Right now we're able to buy and sell stocks, at least it looks like it works
2
00:00:06,120 --> 00:00:11,760
but now, let's also add our funds, let's display how much funds we have and let's see if they get updated
3
00:00:11,760 --> 00:00:14,310
correctly. Once we implemented the funds,
4
00:00:14,310 --> 00:00:18,520
we also want to make sure that we're not able to buy more than we can afford and so on,
5
00:00:18,690 --> 00:00:21,220
so this is what I'll work on next.
6
00:00:21,300 --> 00:00:23,560
Let's start by displaying funds,
7
00:00:23,670 --> 00:00:25,300
where do we display funds?
8
00:00:25,530 --> 00:00:31,050
Well for one, on the home page which generally is not really in the state I want it to have,
9
00:00:31,260 --> 00:00:37,830
so let's quickly work on this, let's wrap it in a div, add a h1 tag where we say trade or view
10
00:00:37,830 --> 00:00:43,280
your portfolio to kind of describe what you're able to do then h6,
11
00:00:43,410 --> 00:00:51,740
you may save and load your data and also h6,
12
00:00:51,850 --> 00:00:58,300
click on end day which doesn't work yet but we'll soon add it to begin a new
13
00:01:00,260 --> 00:01:01,790
day, like that.
14
00:01:02,200 --> 00:01:04,450
All nice but now we also want to display the funds,
15
00:01:04,460 --> 00:01:10,520
so here we have a paragraph which says whoops, which says your funds
16
00:01:10,790 --> 00:01:13,860
and then we want to output our funds like this,
17
00:01:13,880 --> 00:01:15,980
now we clearly don't have access to them yet
18
00:01:16,010 --> 00:01:25,320
so let me add a new script part here where I now export a default object and in there, I will simply
19
00:01:25,320 --> 00:01:29,410
set up a computed property or this computed property and I'll name it funds,
20
00:01:29,430 --> 00:01:35,640
I could use map getters again but since I'm only interested in one getter, I'll access my store like this,
21
00:01:36,390 --> 00:01:40,290
my getters there and then the funds to get my funds.
22
00:01:40,320 --> 00:01:43,280
Now we should be able to see this if we visit the home page,
23
00:01:43,350 --> 00:01:45,460
we see funds 10000,
24
00:01:45,510 --> 00:01:50,640
now let's see if this updates, if I buy ten times BMW it's less
25
00:01:50,730 --> 00:01:54,090
and if I now sell it 10 times, we're back to 10000,
26
00:01:54,090 --> 00:01:55,870
so this indeed seems to work.
27
00:01:56,010 --> 00:02:02,280
Now with that in place, let's also display it in the header and let's make sure that I check my funds
28
00:02:02,280 --> 00:02:05,940
when buying stocks as well as my quantity when selling them.
29
00:02:06,360 --> 00:02:09,530
So let's start by adding funds to the header
30
00:02:10,440 --> 00:02:13,330
and here I simply want to display them, let's say here
31
00:02:13,360 --> 00:02:16,200
after my two links before the dropdown.
32
00:02:16,330 --> 00:02:25,930
So here I'll add this strong element where I say funds equals funds with string interpolation and I'll add some
33
00:02:25,930 --> 00:02:34,040
classes here to position this rightly, this shall be nav bar text, nav bar right.
34
00:02:34,860 --> 00:02:40,200
With that in place, it will not work of course because what I need to do is I need to add my script down
35
00:02:40,200 --> 00:02:44,330
there, export my object and now load the funds there too.
36
00:02:45,120 --> 00:02:51,640
Now I could use map getters for this but since I'm interested in the funds only, I can also say computed
37
00:02:51,640 --> 00:03:02,420
as we learned it before, funds and then simply here return this store getters funds, like this.
38
00:03:02,420 --> 00:03:03,940
Now let's see if this worked,
39
00:03:04,770 --> 00:03:05,210
looks good,
40
00:03:05,220 --> 00:03:07,400
we get the funds on the very right, on the very right
41
00:03:07,440 --> 00:03:13,410
just because of the styles we added to this strong element, that is why it's positioned over there and
42
00:03:13,410 --> 00:03:19,230
we can of course see that these funds also update as soon as we try to do some things.
43
00:03:19,260 --> 00:03:22,020
Now I sold more than I had as you saw,
44
00:03:22,140 --> 00:03:24,500
so that's something we'll work on in the next video
45
00:03:24,500 --> 00:03:29,760
and again, challenge for you, try solving this issue, try to make sure that we're not able to buy more
46
00:03:29,760 --> 00:03:34,250
than we can afford like so or sell more than we have, like so.
47
00:03:34,260 --> 00:03:38,490
So that is what we should work on next, try to fix it on your own first though.
4840
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.