Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,590 --> 00:00:01,130
Okay.
2
00:00:01,130 --> 00:00:01,790
Good friends.
3
00:00:01,790 --> 00:00:08,360
We have completely finished working on this component and I am pretty proud about it.
4
00:00:08,870 --> 00:00:12,210
Now what I want to do is something maybe a little bit simpler.
5
00:00:12,230 --> 00:00:19,650
Now what I want to do is I want to extract this right over here into its own component.
6
00:00:19,710 --> 00:00:21,980
So remember, this is the name card.
7
00:00:23,360 --> 00:00:24,590
So let's go over here.
8
00:00:24,860 --> 00:00:31,340
And usually what you would do is, well, you would create another file in here and you can call this
9
00:00:31,370 --> 00:00:35,600
name card or you can call this whatever it is that you want.
10
00:00:36,260 --> 00:00:41,300
However, let's say you want to create another directory in here.
11
00:00:41,570 --> 00:00:46,910
So maybe over here you want to create a card directory because you might have multiple cards in your
12
00:00:46,910 --> 00:00:47,810
application.
13
00:00:48,230 --> 00:00:53,840
And then right in here you can say that this is going to be the name Dot View File.
14
00:00:54,230 --> 00:00:58,820
So what I'm going to do now is I'm going to go ahead and just grab this.
15
00:00:58,830 --> 00:01:03,160
So this is the component that we have, and I'm going to put it inside of a template.
16
00:01:03,440 --> 00:01:07,550
And then right now, just for now, let's remove all of this.
17
00:01:08,510 --> 00:01:15,440
And then over here, let's just put in leaf and let's go ahead and add a little bit of style.
18
00:01:15,440 --> 00:01:18,980
So I'm going to move the move some of these styles here.
19
00:01:18,980 --> 00:01:20,720
So we've got we need the card.
20
00:01:21,050 --> 00:01:24,560
We need the card P And I believe that's all it is that we really need.
21
00:01:24,890 --> 00:01:26,510
Let's go ahead and save that.
22
00:01:27,080 --> 00:01:32,240
And now what I want to do is I want to render this component.
23
00:01:32,750 --> 00:01:34,480
So how are we going to do that?
24
00:01:34,480 --> 00:01:36,290
So I want to render it right over here.
25
00:01:37,830 --> 00:01:44,480
So you might be thinking, well, I can just say name like so because that is the name of the file.
26
00:01:44,490 --> 00:01:45,900
So I'm going to go ahead and save that.
27
00:01:45,900 --> 00:01:47,760
I'm going to comment this out for now.
28
00:01:48,330 --> 00:01:50,280
So go ahead and save that comment this out.
29
00:01:50,790 --> 00:01:56,220
And let me just go ahead and refresh and you can see that we're not rendering anything.
30
00:01:56,940 --> 00:01:58,710
So why is that?
31
00:01:59,100 --> 00:02:07,470
Well, that's because we actually nested this this name dot view file inside of this card directory.
32
00:02:08,100 --> 00:02:14,700
So now if we want to auto import that in, what we should do is get the folder directory.
33
00:02:14,700 --> 00:02:19,600
So the name of this directory and then also the name of the file.
34
00:02:19,860 --> 00:02:24,240
So if you want to render that, it's going to look something like this card name.
35
00:02:24,480 --> 00:02:28,680
So again, the name of the directory and then the name of the file.
36
00:02:29,040 --> 00:02:30,960
So over here, we're going to go ahead and save that.
37
00:02:30,960 --> 00:02:32,460
And let's go back over here.
38
00:02:32,460 --> 00:02:35,850
And right away you can see that it is working.
39
00:02:36,390 --> 00:02:40,680
Now, of course, you can have multiple directories, multiple nested directory.
40
00:02:40,680 --> 00:02:42,510
So for example, let's add another directory.
41
00:02:42,510 --> 00:02:44,520
You're just saying hello, something like that.
42
00:02:45,030 --> 00:02:47,790
And then right over here, let's actually move that right in there.
43
00:02:49,090 --> 00:02:55,000
I'm sort of go ahead and let's just skip the changes some move this.
44
00:02:56,230 --> 00:02:58,420
So let's go ahead and add that directory again.
45
00:02:58,420 --> 00:03:00,040
So I'm going to say hello.
46
00:03:01,100 --> 00:03:02,120
Or where is that?
47
00:03:02,660 --> 00:03:03,980
It's saying it's there.
48
00:03:04,020 --> 00:03:04,790
Oh, there it is.
49
00:03:05,240 --> 00:03:05,630
Okay.
50
00:03:05,630 --> 00:03:06,830
So it was actually in there.
51
00:03:06,840 --> 00:03:08,240
It's a little confusing for me.
52
00:03:08,630 --> 00:03:12,710
Now, if you go ahead and refresh, you can see that.
53
00:03:13,100 --> 00:03:15,320
Well, now it's yelling at us about this.
54
00:03:15,710 --> 00:03:16,410
So over here.
55
00:03:16,430 --> 00:03:18,560
Now what we're going to do is we're gonna change card.
56
00:03:18,560 --> 00:03:19,580
Hello, name.
57
00:03:19,790 --> 00:03:20,540
And there we go.
58
00:03:20,550 --> 00:03:27,410
You can see that it is working a okay, so it's going to be this name plus this name plus this name.
59
00:03:27,650 --> 00:03:28,880
And obviously I don't want this.
60
00:03:28,880 --> 00:03:35,480
I'm going to move it right back, skip the changes and I am going to get rid of this hello directory
61
00:03:36,080 --> 00:03:39,740
and I'm going to move this right back to card name.
62
00:03:40,430 --> 00:03:42,170
Okay, so there we go.
63
00:03:42,170 --> 00:03:43,820
You can see it is working fine.
64
00:03:44,420 --> 00:03:44,690
Okay.
65
00:03:44,690 --> 00:03:46,280
So this is looking really good.
66
00:03:46,280 --> 00:03:50,870
But now what we need to do is we need to start passing in some data.
67
00:03:51,290 --> 00:03:53,360
So we're going to iterate over this.
68
00:03:53,360 --> 00:03:56,480
So we're going to iterate over this card name.
69
00:03:56,480 --> 00:03:58,340
So we're going to have a V for in here.
70
00:03:58,700 --> 00:04:03,230
And then what we're going to do is we're actually going to go ahead and just pass in the name and the
71
00:04:03,230 --> 00:04:08,090
name is just going to be a string, so it's going to be a unique string.
72
00:04:08,420 --> 00:04:10,130
Let's go ahead and do that now.
73
00:04:10,160 --> 00:04:11,900
Over here, we need to accept it.
74
00:04:11,900 --> 00:04:16,190
So inside of our script tag, I'm going to go ahead script.
75
00:04:16,730 --> 00:04:17,990
Get rid of all this junk.
76
00:04:19,230 --> 00:04:23,230
I'm going to say over here, script set up Lang is equal to TypeScript.
77
00:04:23,760 --> 00:04:28,200
And then right over here, we're going to very similarly accept the props.
78
00:04:28,620 --> 00:04:29,850
So let's go over here.
79
00:04:30,390 --> 00:04:35,130
We're going to say props is going to be equal to define props.
80
00:04:35,460 --> 00:04:38,260
And over here, let's define an interface for this.
81
00:04:38,260 --> 00:04:39,010
So I'm going to say something.
82
00:04:39,030 --> 00:04:40,530
Name props.
83
00:04:41,400 --> 00:04:42,450
So name props.
84
00:04:42,450 --> 00:04:48,270
And this is only going to have a string or sorry, a name that is going to be a string.
85
00:04:48,270 --> 00:04:49,530
That's all it's going to have.
86
00:04:50,190 --> 00:04:52,110
So let's go ahead and copy that in there.
87
00:04:53,280 --> 00:04:59,250
And now, because we have defined the props right over here, we can actually have our actual name.
88
00:04:59,790 --> 00:05:01,350
So you can say name like so.
89
00:05:01,980 --> 00:05:04,870
So now let's go ahead and do that.
90
00:05:04,890 --> 00:05:07,260
And it is not working.
91
00:05:07,770 --> 00:05:09,330
So why is that not working?
92
00:05:09,330 --> 00:05:10,500
We got a name here.
93
00:05:10,710 --> 00:05:15,240
What I'm going to do just to double check is console that, log the props.
94
00:05:17,450 --> 00:05:20,990
Let's console.log the props just to see exactly what we are getting.
95
00:05:23,860 --> 00:05:25,330
So when a consul.
96
00:05:27,740 --> 00:05:29,120
Go to the console here.
97
00:05:29,120 --> 00:05:30,320
We're getting a proxy.
98
00:05:30,590 --> 00:05:33,050
So to go ahead and refresh this search.
99
00:05:33,500 --> 00:05:34,050
Okay.
100
00:05:34,820 --> 00:05:35,460
Search.
101
00:05:35,510 --> 00:05:38,540
I'm not sure exactly what happened before, but now it's working.
102
00:05:38,540 --> 00:05:42,800
So I'm I'm almost flustered why that happened before.
103
00:05:43,040 --> 00:05:44,480
But now you can see that it is working.
104
00:05:44,630 --> 00:05:44,990
Okay.
105
00:05:44,990 --> 00:05:46,670
I probably just needed to refresh.
106
00:05:47,210 --> 00:05:48,910
So that's pretty much it.
107
00:05:48,920 --> 00:05:54,920
And this lesson was really mainly about how we can deal with components that are nested in other directories.
108
00:05:55,250 --> 00:05:57,980
And now you guys know exactly how that works.
109
00:05:58,400 --> 00:06:01,280
So we're almost pretty much done this application.
110
00:06:01,280 --> 00:06:08,270
The only thing that we need to do now is figure out exactly how we can start deleting different names
111
00:06:08,270 --> 00:06:09,710
that we are not interested in.
112
00:06:10,070 --> 00:06:13,310
So let's actually figure out how we can do that in the next video.
9710
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.