Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,420 --> 00:00:04,950
Hi there, welcome back in the annual lecture, guys, in the previous about to be created for a loop
2
00:00:05,190 --> 00:00:11,190
in our template in this lecture, I will show you how we can pass data from component to component.
3
00:00:12,030 --> 00:00:12,800
OK, let's start.
4
00:00:12,810 --> 00:00:14,250
Let's open our code.
5
00:00:14,250 --> 00:00:18,750
In another part of the view we have, here are a nice far loop and a data we are specifying, which
6
00:00:18,750 --> 00:00:21,210
is brand name and menu items.
7
00:00:22,050 --> 00:00:28,200
What I want to show you is how you can pass this data from different component in this case up to the
8
00:00:28,200 --> 00:00:32,910
view component, because other video component is indeed responsible for displaying that number.
9
00:00:33,180 --> 00:00:39,480
So I want to define its data here, and I want to pass them to exchange nav bar and is a very common
10
00:00:39,480 --> 00:00:40,010
practice.
11
00:00:40,020 --> 00:00:45,680
If you have a component that you are using in, let's say, multiple pages or in multiple other components,
12
00:00:45,690 --> 00:00:49,290
you want to make it reusable as soon as possible, as much as possible.
13
00:00:50,040 --> 00:00:56,980
So you want to not define a data in that component, but you want to pass them through the other components.
14
00:00:56,980 --> 00:00:58,650
So it's going to be much more easier.
15
00:00:58,650 --> 00:00:59,610
But I will show example.
16
00:00:59,850 --> 00:01:04,680
For example, let's say you have some quiet component, right?
17
00:01:04,680 --> 00:01:10,710
You have a card component that if you say the card and this card is displaying some data, it doesn't
18
00:01:10,710 --> 00:01:13,590
specify what the data, according to data here, but there are other.
19
00:01:15,050 --> 00:01:17,450
But every page now they're using this data.
20
00:01:17,540 --> 00:01:18,930
It should be page.
21
00:01:19,940 --> 00:01:22,700
Page one, the page.
22
00:01:23,940 --> 00:01:26,160
Page two, let's say Page three.
23
00:01:27,930 --> 00:01:36,030
Page two aerialist pages specifying its own data and passing it to display to the card and the card,
24
00:01:36,360 --> 00:01:37,140
is this played out?
25
00:01:37,420 --> 00:01:42,120
OK, so for example, Page can display the product data page rankings by the product title page two
26
00:01:42,120 --> 00:01:44,400
can display some block data and so on.
27
00:01:44,400 --> 00:01:49,350
But all of them, they are using the same card component and they are passing this, this props, as
28
00:01:49,350 --> 00:01:51,120
you call it, to the card.
29
00:01:51,420 --> 00:01:58,850
So let's say Page one passing title data, content, content and the same for a page doing.
30
00:01:58,860 --> 00:02:04,380
They're passing also title and the content and the card is taking this data and displaying it out.
31
00:02:04,380 --> 00:02:07,380
So that's a concept behind props, as we'll be talking now.
32
00:02:08,490 --> 00:02:13,110
We don't want to display the data in our small components without defining them there, but just receive
33
00:02:13,110 --> 00:02:13,290
them.
34
00:02:14,580 --> 00:02:15,600
OK, you have of talking.
35
00:02:15,600 --> 00:02:16,960
Let's go to North Bartlett Violet.
36
00:02:16,980 --> 00:02:17,400
Let's see.
37
00:02:17,670 --> 00:02:19,860
Let's get the entire data function.
38
00:02:20,460 --> 00:02:26,310
Just get it like this or remove it and get it to the Abdal to view, OK, so under the comprehensive
39
00:02:26,520 --> 00:02:29,370
right comma and you will pass here the data function.
40
00:02:29,370 --> 00:02:32,250
Now you have a print name here and menu items here.
41
00:02:33,390 --> 00:02:34,360
What do you want to do next?
42
00:02:34,380 --> 00:02:39,750
You want to specify in your another component the props later you will receive.
43
00:02:40,620 --> 00:02:46,110
OK, and the relationship, a relationship that they are talking about, is that up to the view component
44
00:02:46,440 --> 00:02:48,630
in the relationship or to the exchange?
45
00:02:48,630 --> 00:02:52,320
No exchange, heroic change list and extras.
46
00:02:52,410 --> 00:02:58,170
Pagination is parent component, and all these components here are child components.
47
00:02:58,500 --> 00:03:02,820
So if the sum component wrapping the other component, the relationship is a parent and the child,
48
00:03:04,350 --> 00:03:11,340
so too are no child component will specify here, will specify the props or to simplify their props
49
00:03:11,340 --> 00:03:11,790
like this?
50
00:03:13,120 --> 00:03:13,650
Alright.
51
00:03:13,650 --> 00:03:17,760
And here we'll specify the name of your product can be whatever, whatever names you will decide to
52
00:03:17,760 --> 00:03:18,390
get here.
53
00:03:18,600 --> 00:03:21,750
The props doesn't have to have a same name as a data you will be.
54
00:03:21,760 --> 00:03:23,910
Yup, you are specifying here.
55
00:03:25,080 --> 00:03:28,440
So, for example, I can specify I would like to get your title.
56
00:03:29,550 --> 00:03:29,950
OK.
57
00:03:30,690 --> 00:03:34,740
Like this and coma and I would like to be safe out here, I would like to get here menu items.
58
00:03:34,740 --> 00:03:36,270
I can just simply call it items.
59
00:03:37,820 --> 00:03:38,180
OK.
60
00:03:39,490 --> 00:03:46,600
Title and items then as specified here, what type of this data will we be able to type?
61
00:03:47,110 --> 00:03:49,630
And we know the title title is a strength.
62
00:03:50,110 --> 00:03:55,120
OK, so specify your strength and we know that items is an area type area.
63
00:03:56,940 --> 00:04:01,560
OK, now we need to do the changes, because what the template up here is trying to get here is a brand
64
00:04:01,620 --> 00:04:02,420
name by the brand.
65
00:04:02,420 --> 00:04:04,270
The name is no longer in the context.
66
00:04:04,290 --> 00:04:11,580
Here we have the only title which will be passed through the Abdul review and we don't have menu items,
67
00:04:11,580 --> 00:04:12,570
but the have only items.
68
00:04:12,570 --> 00:04:13,320
So simple change.
69
00:04:13,320 --> 00:04:18,030
You guys just get a brand name and change it to the title and get here.
70
00:04:18,510 --> 00:04:21,480
Menu items and change them to items like this.
71
00:04:22,550 --> 00:04:22,900
OK.
72
00:04:24,080 --> 00:04:25,640
And now in our update, we'll.
73
00:04:26,660 --> 00:04:30,800
We have a data here now, so what we need to do, we need to pass them to the north, but we will pass
74
00:04:30,800 --> 00:04:31,340
them as this.
75
00:04:32,180 --> 00:04:40,880
Similarly, as to the far loop, you will right here v£ OK, so you can do be bind, a specified column
76
00:04:40,880 --> 00:04:42,080
and the name of the prop.
77
00:04:43,040 --> 00:04:44,750
So they are calling it a prop title.
78
00:04:45,500 --> 00:04:47,090
And will be passing her data.
79
00:04:47,480 --> 00:04:53,600
OK, so to the data, we can pass to the title because are what our brand name, brand name like this?
80
00:04:55,250 --> 00:05:03,260
OK, and then we have here RV bind, you bind and we have here items and that's our menu items.
81
00:05:04,340 --> 00:05:05,870
And yeah, that's all of it to pass.
82
00:05:06,140 --> 00:05:13,880
OK, so title items, that's what they are specifying the title items and in the background, what's
83
00:05:13,880 --> 00:05:14,390
happening?
84
00:05:14,720 --> 00:05:16,310
The brand name gets passed to the title.
85
00:05:16,550 --> 00:05:18,650
Menu items gets passed to the items.
86
00:05:20,680 --> 00:05:25,950
As pretty as far, look, we don't need to specify the bank that's redundant, we can just specify here
87
00:05:25,960 --> 00:05:30,190
title and the items available to be pain killers, but in a background it's a v bind.
88
00:05:31,480 --> 00:05:35,500
OK, let's say that you should see an able to pay a browser doesn't worry for us.
89
00:05:35,500 --> 00:05:40,480
Everything is working as it was before, and that's how you are passing props around.
90
00:05:41,800 --> 00:05:43,900
Let's a couple of options you can define with flare.
91
00:05:44,830 --> 00:05:45,250
OK.
92
00:05:46,180 --> 00:05:51,220
So for example, as I told you, many of them are using the same tags, the balance and you are specifying
93
00:05:51,260 --> 00:05:51,910
directives.
94
00:05:52,270 --> 00:05:54,880
The value is getting passed automatically as a variable.
95
00:05:55,480 --> 00:06:01,780
If I want to pass a string value, I need to wrap it in a quotations like this, but I will save it
96
00:06:02,020 --> 00:06:02,320
now.
97
00:06:02,320 --> 00:06:08,230
I'm not passing the value from the branding variable, but I am passing the Arrow brand name value.
98
00:06:08,920 --> 00:06:10,300
Somebody will display discipline my page.
99
00:06:11,350 --> 00:06:12,310
Be the brand name.
100
00:06:12,730 --> 00:06:13,080
OK.
101
00:06:14,500 --> 00:06:18,370
OK, but of course, you want to pass it as the variable because they are holding this value there.
102
00:06:19,890 --> 00:06:20,610
OK, what else?
103
00:06:20,700 --> 00:06:25,590
What I can show is there's some options we have enough bar have, we can specify and also default value.
104
00:06:25,680 --> 00:06:29,490
So for example, let's have it articulated actual it's been right there.
105
00:06:29,490 --> 00:06:30,510
Something is required.
106
00:06:32,100 --> 00:06:32,850
Ellen Mackey through us.
107
00:06:32,850 --> 00:06:37,680
Very clear it and I will go to applaud you and I will say, OK, I'm not passing this brand name.
108
00:06:38,550 --> 00:06:41,750
Okay, I'll save it now, and we'll go to browser refresh.
109
00:06:41,790 --> 00:06:42,570
I don't have any brand name.
110
00:06:42,570 --> 00:06:45,120
As you can see, I'll get the warrant in the console.
111
00:06:45,120 --> 00:06:51,750
So an evil open console, so control out and eye or comment option and I right click and inspect.
112
00:06:53,020 --> 00:06:54,430
You should see here and I console.
113
00:06:55,680 --> 00:07:02,730
Macy Gray, cloud prop title, OK, they're passing on enough budget items, but they're not passing
114
00:07:02,750 --> 00:07:03,750
our title.
115
00:07:05,180 --> 00:07:09,230
OK, so that's very clear, but of course, of course, we could not give the required force and we'll
116
00:07:09,230 --> 00:07:13,340
be in on the Escalades and be able to get any issues, but we will also display anything.
117
00:07:14,290 --> 00:07:15,070
So it's false.
118
00:07:16,130 --> 00:07:16,910
We're getting the morning.
119
00:07:18,430 --> 00:07:23,860
But you have also shown to be have you specify her default default like this and default will be, let's
120
00:07:23,860 --> 00:07:27,850
say, my default name or my default title?
121
00:07:29,200 --> 00:07:29,560
OK.
122
00:07:29,620 --> 00:07:33,340
And you will do it like this, then you don't need to pass here.
123
00:07:33,340 --> 00:07:38,500
The title above and the title is not the default value for the title is yours, which is my default
124
00:07:38,500 --> 00:07:38,840
title.
125
00:07:38,840 --> 00:07:43,270
Then you will say it like this, but I go to the brave browser or any browser.
126
00:07:43,570 --> 00:07:45,520
It will display my default title.
127
00:07:47,320 --> 00:07:52,960
OK, so we can specify, or do you feel the value by not making the exchange or.
128
00:07:54,590 --> 00:07:56,610
OK, just so you can see it.
129
00:07:57,740 --> 00:07:58,040
OK.
130
00:07:58,540 --> 00:07:59,530
We can still pass it.
131
00:07:59,660 --> 00:08:00,580
OK, no big deal.
132
00:08:00,590 --> 00:08:01,280
They can stop us.
133
00:08:01,280 --> 00:08:09,520
Here are a title, but it will be our brand name, right brand brand name and the items menu items will
134
00:08:09,590 --> 00:08:13,250
pass as the regular because that's very important for us to pass on the menu items.
135
00:08:13,250 --> 00:08:22,730
So let's go to the bar and let's pursue five year items will be very quiet, very quiet and this will
136
00:08:22,760 --> 00:08:23,720
be true value.
137
00:08:25,100 --> 00:08:26,090
OK, perfect.
138
00:08:27,380 --> 00:08:33,890
We will verify everything looks good here of us passing title items here, we have some complaints.
139
00:08:35,570 --> 00:08:37,760
Let's see what is this complaining about.
140
00:08:39,720 --> 00:08:44,970
Actually, no campaign has been registered, but not to use it, didn't remember something in they are
141
00:08:44,970 --> 00:08:45,330
here.
142
00:08:46,050 --> 00:08:46,440
OK.
143
00:08:47,890 --> 00:08:49,810
Now, let's have it back here.
144
00:08:49,840 --> 00:08:53,980
Everything is working as before, and they'll be using this concept a lot, perhaps is a very heavily
145
00:08:53,980 --> 00:09:00,310
used concept in almost every framework or library as they react angular and so on.
146
00:09:00,310 --> 00:09:02,320
So you'll be using it a lot.
13689
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.