Hello again, everyone.
So we've created a project where we're going to start the subject of data binding.
All right.
So in this lesson, we will add the data model to the project.
All right.
So we're going to take this step by step, do these steps together.
And this is how you're going to learn what you need to know with Angular.
All right.
So we will design this project about book sales and we're going to have a book sales website and we
will design a site where books are listed, prices are available.
And, of course, we're going to do a few other things as well.
So this is a great way to, you know, build a practice place, and that way we can understand some
of the issues that may or may not arise.
All right.
So let's start preparing a project for now.
I'm creating a model file to hold the data underneath this app folder.
And we're making a class definition in this file.
Of course, we export the class to use it outside.
So I'm starting to define the variables that we're going to use in constructor.
And I will define variables such as I.D. name, respectively.
So define these variables to be public and optional.
All right, so we have got variables that we can use outside this class.
All right, so we have now made the variable definitions that we need to use, and if we need a different
variable later, we can always define it here.
It's creating one more model class, and in this class, this will return the list of the book model
class that we just created.
So first time doing class definition.
And of course, we will have to import the booked out model class in order to use the variables that
we created in it.
And I'll make an array definition because I want to return a list.
And the type of this will be in the class type that we first created.
And now I'm creating a new item in the constructor.
And of course, we will use the variable sequentially here as parameters.
I mean, these parameters will come from the first model class that we created.
All right, and as you can see here, the I.D. helps us while using them here and here.
Right, which values to use.
So enter the values and I describe the first item and I'll be adding a few more of these list items.
Now just quickly change some of their values.
All right, so our list is ready for now.
All right, so we will now define our list as private.
All right, so that means that we won't be able to use it outside.
So I'm creating the get method and that will convert it to a public structure.
Right.
That way, we'll be able to use this list outside of this class.
They'll create another model class, and this is where we will write our methods.
Now, add each list item that will come up in this class to the book's array that we will define here.
So when we create an example from these classes here, we will throw the elements that will come in
to this class into this array.
And that means we're going to use the for each method, for each element and the push method to add.
So when we create this class, it's going to get the list here and it will assign it to this element.
All right, so now we're done with this class and we'll continue on the list here.
Now, this will be the first place to find information about the book that we will create, right.
For example, here we can return these elements with a get books method and we're going to add our methods
into this class as needed.
We can add, delete or update products.
All right, so now we have established a structure that will keep data methods and provide information,
so we have created three model classes for this.
So in this class, we've created a general scheme.
And when we want to add a book to the list, the necessary information is here.
So here we created a book model and created a structure in this classroom that using the book model
and initially returning a list to us, and then finally we created this class where we will operate
on this list and prepare some methods.
And in that way, we have created a structure that provides the basic flow of information.
So in the next lesson, we're going to create the component structure where we will continue our project.
All right.
See you then.
Bye for now.