Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,450 --> 00:00:03,620
We've got many aspects of this thing put together.
2
00:00:03,690 --> 00:00:08,800
Let's now make sure that whenever user clicks on say a number we update the value of that current page
3
00:00:08,800 --> 00:00:09,750
property.
4
00:00:09,740 --> 00:00:14,920
But to do so I'm going to flip back over to my template inside of the ally where we have our energy
5
00:00:14,920 --> 00:00:16,310
for DirecTV.
6
00:00:16,350 --> 00:00:20,530
I'm going to add a click event handler on the anchor tag itself.
7
00:00:20,950 --> 00:00:22,580
Here's my anchor tag.
8
00:00:22,580 --> 00:00:25,540
I'm going to watch for the like event.
9
00:00:25,540 --> 00:00:30,460
And remember we can do that by adding on a set of parentheses around the name of the events that we
10
00:00:30,460 --> 00:00:31,710
want to watch for.
11
00:00:31,930 --> 00:00:36,460
Now whenever a user clicks on this anchor tag we're going to run whatever code we put inside those double
12
00:00:36,460 --> 00:00:39,000
quotes inside of here.
13
00:00:39,080 --> 00:00:42,280
We could call some method on our class very easily.
14
00:00:42,350 --> 00:00:46,810
We can call a method back over on the app components that will update the value of current page where
15
00:00:46,820 --> 00:00:52,190
alternatively we could just write in a statement right here to update the value of the current page
16
00:00:52,190 --> 00:00:53,220
property.
17
00:00:53,300 --> 00:01:00,340
We could say current page equals I that's going to take a look at the current page property on our component
18
00:01:00,730 --> 00:01:03,800
and update it to whatever I is remember.
19
00:01:03,940 --> 00:01:11,640
I is going to be the index or the image that we are currently iterating over this syntax right here.
20
00:01:11,660 --> 00:01:15,100
It's just a bit more concise a little bit easier to write out than the old method.
21
00:01:15,100 --> 00:01:20,790
Back inside the app components although we definitely can do that it's not going to say this look back
22
00:01:20,790 --> 00:01:25,620
over now should be able to click on each these different different buttons and see it updates.
23
00:01:25,640 --> 00:01:30,440
I can also see that the previous and next buttons it enabled or disabled as soon as I go right next
24
00:01:30,440 --> 00:01:33,080
to them but this looks pretty good.
25
00:01:33,090 --> 00:01:37,460
Let's now implement something very similar to the previous button and the next button.
26
00:01:37,470 --> 00:01:43,750
Make sure that whenever we click on those we adjust the current page property as well to first find
27
00:01:43,750 --> 00:01:49,820
the button that we are rendering for the previous button and then on the anchor tag for that.
28
00:01:49,810 --> 00:01:59,180
I'll once again add in a click event handler and I'll say current page is current page minus one.
29
00:01:59,180 --> 00:02:03,860
Once again we could define a helper method on the class to do this but that's a lot of extra code will
30
00:02:03,870 --> 00:02:05,420
be easier to just write it in line.
31
00:02:05,420 --> 00:02:06,170
For this example
32
00:02:09,030 --> 00:02:14,410
now we can go down to the very last button here is our last ally right here.
33
00:02:14,430 --> 00:02:19,630
Find the anchor tag once again Watch for click.
34
00:02:19,770 --> 00:02:25,460
I'll say current age is current age plus 1
35
00:02:29,670 --> 00:02:30,120
OK.
36
00:02:30,120 --> 00:02:31,290
I think this looks pretty good.
37
00:02:31,320 --> 00:02:33,710
So let's save this and do one more test.
38
00:02:33,870 --> 00:02:34,590
Back over here.
39
00:02:34,620 --> 00:02:36,760
I should now be able to click on previous.
40
00:02:36,840 --> 00:02:42,590
Go back and next to go forward as soon as I get to the last link I can't click on Next anymore.
41
00:02:42,600 --> 00:02:45,500
Now as soon as I get to the first one I can't click on previous anymore.
42
00:02:45,810 --> 00:02:48,270
Let's say this looks pretty good.
43
00:02:48,370 --> 00:02:48,710
All right.
44
00:02:48,730 --> 00:02:49,770
So let's take a pause right here.
45
00:02:49,780 --> 00:02:53,130
When we come back the next video we're going to make sure that we show some images on the screen.
46
00:02:53,140 --> 00:02:55,660
We're going to start to take a look at yet another directive.
4567
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.