1
00:00:00,330 --> 00:00:01,120
Hello again, everyone.

2
00:00:01,140 --> 00:00:04,700
So in our last lesson, we introduce the subject of data binding.

3
00:00:05,190 --> 00:00:11,370
Now, I'll continue on this topic in this lesson, because I want to show you the use of string interpolation.

4
00:00:13,690 --> 00:00:16,900
So I want to continue on this component.

5
00:00:18,010 --> 00:00:22,390
Now, see here, there's a static variable in the HTML page.

6
00:00:23,510 --> 00:00:26,180
Actually, we want to make it static.

7
00:00:27,190 --> 00:00:32,350
So I want this to change with variables, I will use the typescript page.

8
00:00:33,260 --> 00:00:35,050
Now, let's see how we do it.

9
00:00:37,400 --> 00:00:44,120
So look at this here now we are showing a product here, and I want this product to have an I.D. and

10
00:00:44,120 --> 00:00:48,650
I want to make this I.D. definition and typescript file.

11
00:00:49,660 --> 00:00:51,910
Actually, I use it in the e-mail page.

12
00:00:53,140 --> 00:00:57,220
So now I'll create this dynamic feel and the typescript file.

13
00:00:58,810 --> 00:01:01,810
And we're going to do these operations in this class.

14
00:01:03,440 --> 00:01:10,520
I'm now defining a number variable as product ID, and I'll write one as the value.

15
00:01:12,720 --> 00:01:17,550
That the second variable we can check whether to see if it's in stock or not.

16
00:01:18,770 --> 00:01:23,000
So define a string variable and call it stock status.

17
00:01:24,990 --> 00:01:30,510
So we can enter yes or no as a value right now and ah, yes.

18
00:01:31,610 --> 00:01:39,020
Now, as we talked about earlier in typescript, we had no problem when we give an initial value here.

19
00:01:41,460 --> 00:01:47,010
So I've used this variable as no, but of course, we can use it that way, right?

20
00:01:47,790 --> 00:01:49,800
Same goes for string values.

21
00:01:51,230 --> 00:01:56,420
Right, so I choose to use it here so that you can see both uses.

22
00:01:57,780 --> 00:01:58,290
All right.

23
00:01:59,250 --> 00:02:04,140
So now it's time to learn how to use these variables in the HTML file.

24
00:02:06,020 --> 00:02:07,940
So now I'm doing the edits here and.

25
00:02:11,090 --> 00:02:15,560
The first to come up will be the first dynamic variable in these.

26
00:02:16,710 --> 00:02:21,120
Now we've got to use double curly braces to define this variable here.

27
00:02:22,100 --> 00:02:25,130
And inside of that, I write a variable name.

28
00:02:26,450 --> 00:02:28,980
There may be different uses between these brackets, of course.

29
00:02:29,540 --> 00:02:34,190
For example, we can write a string value or we can call a string method or.

30
00:02:35,380 --> 00:02:42,610
We can do mathematical operations, for example, adding to numbers, but we won't be able to use multiple

31
00:02:42,610 --> 00:02:47,530
lines, block statements or loops, does that make sense?

32
00:02:48,490 --> 00:02:51,610
So as a result, the value is going to be a string.

33
00:02:53,320 --> 00:02:58,360
All right, so that is the basic use of string interpolation.

34
00:02:59,720 --> 00:03:08,510
We've defined a variable in the typescript file and we called it in double curly braces inside the HDMI

35
00:03:08,510 --> 00:03:08,900
file.

36
00:03:11,150 --> 00:03:15,860
All right, so now let's finish the edits and see what we can do in the browser.

37
00:03:17,540 --> 00:03:23,240
And here we can see the values that we give to typescript and look at this, we actually define the

38
00:03:23,240 --> 00:03:25,430
ID value as number.

39
00:03:26,270 --> 00:03:30,050
We said in the string interpolation, the result would be string.

40
00:03:30,860 --> 00:03:36,190
And this didn't cause any problems because and no value can easily be converted to a string.

41
00:03:37,070 --> 00:03:38,290
So that's no problem.

42
00:03:39,600 --> 00:03:46,680
But now I want to show you how to use the method and double brackets before we finish our lesson.

43
00:03:47,520 --> 00:03:55,350
So for this, I'll first write a simple method in the typescript file and return this value with method.

44
00:03:57,490 --> 00:04:00,730
Now, I call Method in HTML and.

45
00:04:03,650 --> 00:04:10,730
There's no change when we've saved the changes because the result of the method turned into a string

46
00:04:10,730 --> 00:04:12,890
easily and it worked without any problems.

47
00:04:13,720 --> 00:04:14,200
All right.

48
00:04:15,380 --> 00:04:18,530
So that's how I use string interpolation.

49
00:04:19,830 --> 00:04:23,260
Now we're going to talk about property buiding and our next lesson.

50
00:04:23,610 --> 00:04:24,660
So until then.

51
00:04:26,250 --> 00:04:29,250
Have some fun, but review a few things as well.

52
00:04:29,640 --> 00:04:31,200
All right, see you next time.
