1
00:00:01,050 --> 00:00:02,150
Hello again, everyone.

2
00:00:02,250 --> 00:00:07,210
So we've created a project where we're going to start the subject of data binding.

3
00:00:08,610 --> 00:00:08,970
All right.

4
00:00:08,980 --> 00:00:13,440
So in this lesson, we will add the data model to the project.

5
00:00:14,640 --> 00:00:14,910
All right.

6
00:00:14,910 --> 00:00:18,510
So we're going to take this step by step, do these steps together.

7
00:00:19,170 --> 00:00:23,370
And this is how you're going to learn what you need to know with Angular.

8
00:00:24,150 --> 00:00:24,420
All right.

9
00:00:24,420 --> 00:00:34,200
So we will design this project about book sales and we're going to have a book sales website and we

10
00:00:34,200 --> 00:00:38,010
will design a site where books are listed, prices are available.

11
00:00:38,310 --> 00:00:40,880
And, of course, we're going to do a few other things as well.

12
00:00:42,800 --> 00:00:49,340
So this is a great way to, you know, build a practice place, and that way we can understand some

13
00:00:49,340 --> 00:00:52,280
of the issues that may or may not arise.

14
00:00:53,240 --> 00:00:53,480
All right.

15
00:00:53,480 --> 00:00:55,880
So let's start preparing a project for now.

16
00:00:55,880 --> 00:01:00,770
I'm creating a model file to hold the data underneath this app folder.

17
00:01:05,370 --> 00:01:08,290
And we're making a class definition in this file.

18
00:01:09,260 --> 00:01:12,450
Of course, we export the class to use it outside.

19
00:01:17,850 --> 00:01:22,590
So I'm starting to define the variables that we're going to use in constructor.

20
00:01:24,130 --> 00:01:29,770
And I will define variables such as I.D. name, respectively.

21
00:01:38,550 --> 00:01:42,250
So define these variables to be public and optional.

22
00:01:43,590 --> 00:01:48,780
All right, so we have got variables that we can use outside this class.

23
00:02:07,530 --> 00:02:12,900
All right, so we have now made the variable definitions that we need to use, and if we need a different

24
00:02:12,900 --> 00:02:15,210
variable later, we can always define it here.

25
00:02:16,640 --> 00:02:25,010
It's creating one more model class, and in this class, this will return the list of the book model

26
00:02:25,010 --> 00:02:27,020
class that we just created.

27
00:02:31,840 --> 00:02:33,820
So first time doing class definition.

28
00:02:41,460 --> 00:02:48,180
And of course, we will have to import the booked out model class in order to use the variables that

29
00:02:48,180 --> 00:02:48,990
we created in it.

30
00:02:56,700 --> 00:03:00,660
And I'll make an array definition because I want to return a list.

31
00:03:02,370 --> 00:03:06,480
And the type of this will be in the class type that we first created.

32
00:03:20,930 --> 00:03:23,120
And now I'm creating a new item in the constructor.

33
00:03:24,220 --> 00:03:29,590
And of course, we will use the variable sequentially here as parameters.

34
00:03:32,390 --> 00:03:36,110
I mean, these parameters will come from the first model class that we created.

35
00:03:38,130 --> 00:03:44,430
All right, and as you can see here, the I.D. helps us while using them here and here.

36
00:03:45,270 --> 00:03:47,690
Right, which values to use.

37
00:03:48,570 --> 00:03:58,740
So enter the values and I describe the first item and I'll be adding a few more of these list items.

38
00:04:01,910 --> 00:04:04,250
Now just quickly change some of their values.

39
00:04:24,980 --> 00:04:27,710
All right, so our list is ready for now.

40
00:04:30,310 --> 00:04:34,950
All right, so we will now define our list as private.

41
00:04:35,000 --> 00:04:39,380
All right, so that means that we won't be able to use it outside.

42
00:04:40,370 --> 00:04:46,030
So I'm creating the get method and that will convert it to a public structure.

43
00:04:46,430 --> 00:04:46,750
Right.

44
00:04:48,200 --> 00:04:52,400
That way, we'll be able to use this list outside of this class.

45
00:05:04,310 --> 00:05:10,260
They'll create another model class, and this is where we will write our methods.

46
00:05:27,280 --> 00:05:33,010
Now, add each list item that will come up in this class to the book's array that we will define here.

47
00:05:47,700 --> 00:05:53,520
So when we create an example from these classes here, we will throw the elements that will come in

48
00:05:53,850 --> 00:05:55,830
to this class into this array.

49
00:06:11,410 --> 00:06:19,660
And that means we're going to use the for each method, for each element and the push method to add.

50
00:06:21,830 --> 00:06:28,160
So when we create this class, it's going to get the list here and it will assign it to this element.

51
00:06:30,170 --> 00:06:36,380
All right, so now we're done with this class and we'll continue on the list here.

52
00:06:38,240 --> 00:06:44,570
Now, this will be the first place to find information about the book that we will create, right.

53
00:06:45,260 --> 00:06:53,690
For example, here we can return these elements with a get books method and we're going to add our methods

54
00:06:53,690 --> 00:06:55,460
into this class as needed.

55
00:06:56,910 --> 00:07:00,330
We can add, delete or update products.

56
00:07:04,450 --> 00:07:12,490
All right, so now we have established a structure that will keep data methods and provide information,

57
00:07:14,140 --> 00:07:17,430
so we have created three model classes for this.

58
00:07:18,960 --> 00:07:22,260
So in this class, we've created a general scheme.

59
00:07:22,900 --> 00:07:27,700
And when we want to add a book to the list, the necessary information is here.

60
00:07:29,160 --> 00:07:36,630
So here we created a book model and created a structure in this classroom that using the book model

61
00:07:36,630 --> 00:07:43,920
and initially returning a list to us, and then finally we created this class where we will operate

62
00:07:43,920 --> 00:07:46,680
on this list and prepare some methods.

63
00:07:47,880 --> 00:07:52,850
And in that way, we have created a structure that provides the basic flow of information.

64
00:07:54,120 --> 00:08:00,000
So in the next lesson, we're going to create the component structure where we will continue our project.

65
00:08:00,030 --> 00:08:00,390
All right.

66
00:08:01,140 --> 00:08:01,730
See you then.

67
00:08:01,920 --> 00:08:02,660
Bye for now.
