Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,810 --> 00:00:02,880
Let's continue working on our application.
2
00:00:02,880 --> 00:00:07,350
The next thing we're going to do is add in these previous and next buttons on the left and right hand
3
00:00:07,350 --> 00:00:11,760
side of our list of numbers that these two buttons are going to be hard coded in.
4
00:00:11,760 --> 00:00:15,160
So they're not going to be placed inside the energy for DirecTV.
5
00:00:15,180 --> 00:00:20,860
Once we place them we are gonna have to make sure that we conditionally show the disabled class on them.
6
00:00:20,970 --> 00:00:25,950
If we had the disabled class on that L.A. element that's going to show up as gray and not be clickable
7
00:00:26,100 --> 00:00:33,100
which is definitely what we want back inside my template right underneath the L element but above the
8
00:00:33,100 --> 00:00:39,280
existing l I can add in another ally with the class of page dash item as well.
9
00:00:40,860 --> 00:00:48,100
And inside that Ally I'll show an anchor tag with a class of page dash link and I'll give it some hard
10
00:00:48,100 --> 00:00:54,830
coded text of previous or the R evey short from previous then I can duplicate that.
11
00:00:54,840 --> 00:01:02,400
Ally I'll put it on the other side of our energy for DirecTV ally and right down there I'll change the
12
00:01:02,400 --> 00:01:06,610
name on that one to next okay.
13
00:01:06,690 --> 00:01:12,480
Now if we save this and flip back over we'll see that whenever we have page number one selected the
14
00:01:12,480 --> 00:01:16,920
previous button is enabled by I can kind of like mouse over it and it's very clear that I could probably
15
00:01:16,920 --> 00:01:19,040
click on this and change a page.
16
00:01:19,320 --> 00:01:24,900
As we mentioned at the start of this application if we are on page one or the last page we probably
17
00:01:24,900 --> 00:01:30,660
want to make sure that the previous or next button gets disabled we can once again use the energy class
18
00:01:30,660 --> 00:01:32,490
directive to achieve that.
19
00:01:32,640 --> 00:01:37,380
We're gonna take a look at whatever the current page property is on our app class.
20
00:01:37,620 --> 00:01:44,270
And if the current page is equal to one or the last page we can conditionally add on the disabled class.
21
00:01:44,520 --> 00:01:46,550
So let's figure out how to do that.
22
00:01:46,750 --> 00:01:49,610
I inside my editor I'm going to go to my app component class.
23
00:01:49,710 --> 00:01:53,490
I just want to remind you very quickly that we've got this current page property.
24
00:01:53,490 --> 00:01:58,260
And over time we're going to eventually update the value of this current page as a user clicks on some
25
00:01:58,260 --> 00:02:05,000
different buttons inside of our pages later go back inside of my templates I'll find an ally that we
26
00:02:05,000 --> 00:02:07,090
just added in the previous button.
27
00:02:07,360 --> 00:02:12,900
I'm going to give myself a little bit of space on their and then I'll once again use the energy class
28
00:02:12,990 --> 00:02:19,080
directive though in this case we want to conditionally apply the class disabled.
29
00:02:19,130 --> 00:02:26,490
I'm going to use that kind of object syntax we use down here once again I'll put in an object and I'll
30
00:02:26,490 --> 00:02:32,920
say disabled is gonna be applied whenever current page is equal to zero.
31
00:02:33,100 --> 00:02:40,600
So if we are at the very first page I want to disable this first button they'll save this look back
32
00:02:40,600 --> 00:02:45,940
over and sure enough now that first button right there is disabled it doesn't get highlighted it's kind
33
00:02:45,940 --> 00:02:53,510
of great out definitely what we want now we can do the same thing to the last button as well I'm going
34
00:02:53,510 --> 00:03:00,220
to copy that and G class directive that we just wrote out we'll go down to the last ally down here that
35
00:03:00,220 --> 00:03:07,790
we just created a paste in the energy class and now in this scenario rather than showing disabled whenever
36
00:03:07,800 --> 00:03:13,950
current page is equal to zero we instead want to apply disabled whenever our front page is equal to
37
00:03:14,280 --> 00:03:16,930
images not length minus one.
38
00:03:17,040 --> 00:03:22,500
And let me zoom out so you can see that line and I will New Line it as well just to make it easier to
39
00:03:22,500 --> 00:03:22,790
see
40
00:03:26,760 --> 00:03:30,020
for all the zooming OK.
41
00:03:30,050 --> 00:03:35,410
So now to really test this out we need to be able to modify our current page property for right now
42
00:03:35,470 --> 00:03:40,390
let's just go back over to our app components and we will manually change the value of current page
43
00:03:42,490 --> 00:03:48,110
right now I have four images total I'm going to change current page to three.
44
00:03:48,140 --> 00:03:51,900
Remember this variable is zero index.
45
00:03:52,140 --> 00:03:58,210
Now I can't flip back over I have my last page selected and the next button is now great out it so it
46
00:03:58,220 --> 00:04:02,110
looks pretty good though quick pause right here and continue in just a moment.
5448
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.