Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,910 --> 00:00:05,880
Hopefully you had some success putting together a couple of different objects inside of here.
2
00:00:05,900 --> 00:00:09,620
In total I've got one two three four different images.
3
00:00:09,860 --> 00:00:11,690
Now we've got all these images inside of here.
4
00:00:11,690 --> 00:00:16,220
I would encourage you to just double check and make sure that all these your cells look at least somewhat
5
00:00:16,220 --> 00:00:17,020
similar.
6
00:00:17,090 --> 00:00:21,950
Notice how all of mine are images not on Splash dot com FLASH PHOTO.
7
00:00:22,070 --> 00:00:29,240
Reason I mentioned that is that you might very accidentally on one splash right click an image and then
8
00:00:29,240 --> 00:00:31,350
click on copy link address.
9
00:00:31,370 --> 00:00:33,320
Make sure that you didn't copy any link addresses.
10
00:00:33,320 --> 00:00:36,800
Instead we want to always copy an image address.
11
00:00:36,850 --> 00:00:37,060
All right.
12
00:00:37,060 --> 00:00:42,010
So now that we've got all these images let's start to work on this actual page nation thing that's going
13
00:00:42,010 --> 00:00:47,020
to be this kind of list of buttons that we want to display to the user to build something like this.
14
00:00:47,020 --> 00:00:51,260
We're going to be making use of that energy for DirecTV that we've seen a couple of times.
15
00:00:51,310 --> 00:00:54,070
Now I know that we've made use of the energy for DirecTV already.
16
00:00:54,070 --> 00:00:58,210
So this is going to be a little bit of a review but don't worry we're going to throw in a couple of
17
00:00:58,360 --> 00:01:03,830
extra features around energy for just see really understand what is going on behind the scenes.
18
00:01:03,910 --> 00:01:08,710
We're going to run the energy for DirecTV over our list of images and for every image we're going to
19
00:01:08,710 --> 00:01:14,080
try to print out an ally like the one we saw back over here on a bootstrapped documentation page.
20
00:01:14,590 --> 00:01:16,630
Essentially we're just gonna write out a little bit of each team.
21
00:01:16,630 --> 00:01:16,910
All right.
22
00:01:16,910 --> 00:01:23,580
Now let's get to it inside of our app component template but here's my app component template there's
23
00:01:23,580 --> 00:01:25,640
a lot of boilerplate inside of here right now.
24
00:01:25,750 --> 00:01:31,380
I'm going to highlight everything and delete it and then I will replace it with the same structure of
25
00:01:31,380 --> 00:01:38,800
HDL that we just saw over on the documentation going to first place a nav inside the NAB.
26
00:01:38,810 --> 00:01:41,780
I'm going to place a well with the class of pageant nation
27
00:01:44,950 --> 00:01:45,820
inside of that.
28
00:01:45,850 --> 00:01:50,370
I'm going to display an ally on the fly.
29
00:01:50,430 --> 00:01:54,840
I'll add a class of page dash item inside the fly.
30
00:01:54,870 --> 00:02:00,290
Finally I'll display an anchor tag with a class of page dash link.
31
00:02:00,360 --> 00:02:04,170
I'll close off the anchor tag OK.
32
00:02:04,280 --> 00:02:08,440
So now as we start to write this stuff out we want to duplicate this ally.
33
00:02:08,510 --> 00:02:10,940
We want to duplicate the ally and everything inside of it.
34
00:02:11,000 --> 00:02:16,700
One time for each image object that we have inside of this images array but to do so we'll use that
35
00:02:16,730 --> 00:02:18,310
energy for DirecTV.
36
00:02:18,410 --> 00:02:23,620
We're going to find the element that we want to duplicate which in this case is the ally on there all
37
00:02:23,690 --> 00:02:32,520
add on star and G4 let image of images right now.
38
00:02:32,530 --> 00:02:37,910
Really just trying to build out the list of links that a user can click on inside the anchor tag.
39
00:02:37,930 --> 00:02:42,610
As we just saw inside that bootstrap documentation we really want to show something like say one or
40
00:02:42,610 --> 00:02:47,290
two or three or four that the user understands that there are like four images that they can possibly
41
00:02:47,290 --> 00:02:51,820
click on but right away that kind of presents a problem for us by default.
42
00:02:51,820 --> 00:02:56,710
The energy for DirecTV is going to iterate over this array of objects that we have right now.
43
00:02:56,710 --> 00:03:02,140
We really just have access to each image object that we could print out something about the image but
44
00:03:02,140 --> 00:03:05,760
not necessarily which index this image is at.
45
00:03:05,860 --> 00:03:10,600
But to get around this we're going to add in just a little bit of extra syntax to the energy for DirecTV
46
00:03:11,380 --> 00:03:16,790
at the very end of the left image for images statement to put in a semicolon.
47
00:03:16,790 --> 00:03:24,260
Then I'll say let I equals index like so it turns out that there are a couple of other variables that
48
00:03:24,260 --> 00:03:27,610
are accessible to us when we make use of the energy for DirecTV.
49
00:03:27,770 --> 00:03:31,560
They allow us to look up things like say the index we are currently iterating over.
50
00:03:31,640 --> 00:03:34,670
We can also use this kind of aliasing syntax that you see right here.
51
00:03:34,670 --> 00:03:36,870
That's what this is referred to aliasing.
52
00:03:37,000 --> 00:03:41,810
You get access to a Boolean that tells us whether or not we are iterating over the first element in
53
00:03:41,810 --> 00:03:42,800
the array.
54
00:03:42,800 --> 00:03:48,620
The last element whether or not this is an even numbered index or an odd numbered index and so on again
55
00:03:48,620 --> 00:03:52,490
there are a couple of extra variables that are kind of floating around here behind the scenes.
56
00:03:52,490 --> 00:03:59,560
We can get access to using this kind of aliasing syntax now inside the anchor tag.
57
00:03:59,640 --> 00:04:05,060
I can print up that variable that I just alias which is I inside there.
58
00:04:05,070 --> 00:04:12,130
I'll put in I like so I'll then save this going to flip back over and there we go.
59
00:04:12,130 --> 00:04:17,470
So I've got 0 1 2 and 3 being displayed because I have or different images total.
60
00:04:17,590 --> 00:04:22,480
Now of course a user doesn't really understand that our arrays are zero indexed.
61
00:04:22,480 --> 00:04:26,380
Rather than showing 0 1 2 3 we should really show 1 2 3 4.
62
00:04:27,070 --> 00:04:33,600
But to do so we could just go back over to our interpolation right here and add in I plus 1 if we now
63
00:04:33,600 --> 00:04:37,780
save that we see one two three four very good.
64
00:04:37,810 --> 00:04:38,020
All right.
65
00:04:38,050 --> 00:04:40,450
So again just a quick review of the energy for DirecTV.
66
00:04:40,600 --> 00:04:41,620
Let's take a pause right here.
67
00:04:41,620 --> 00:04:45,520
When come back the next video we're gonna start to take a look at some more complex directives.
7284
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.