Now that we've put our user together, we're going to repeat the same process and create a second file
to represent a company inside of our application as well.
So to get started inside of my SIRC directory, I'll make a new file called Company that's inside of
you.
I'm going to once again import the Fakher module from Fakher and I'll define a new class and immediately
export it called company.
So let's think about what different properties we might want a company to have.
I think that maybe if you go back over to the documentation for Fakher one more time, remember, we
have that company section, so we've got different properties in here like, say, company name and
we've got catchphrase and some other stuff like that as well.
So let's have every company have a company name, property.
There will be a string and a catchphrase property that will be a string as well.
In addition, will also have a company have a location that will be a latitude and longitude that's
going to represent their physical location in the world so we can eventually represent them as a marker
on our map.
OK, so back over here, we'll do a company name that is a string and then we'll do a catchphrase.
That is a string.
We'll also do a location that's going to an object with a latitude property that is a number and a longitude
property that is a number as well.
Now, one thing I want to mention here is that calling the company name, company name is really not
necessary.
I think a much more ideal property name here would be name like so.
But I just want to give it some differentiation from our user who had a name property as well.
So just to make a little bit more stark difference between a company and a user, I'm going to have
the company have a property of company name instead.
All right, so now once again, we can define our constructor function, which is where we're going
to initialize all those different properties.
So I'll say this DOT company name.
We'll be Fakher company, dot company name like, so let me collapse the sidebar so we can see that
whole line.
We can then do our catchphrase.
Which will be Fakher company dot catchphrase.
And then finally, we can also initialize our latitude and longitude as well, remember, like we just
discussed, this right here does not initialize the location property.
It just tells TypeScript here's what location will be.
So if we try to assign a value directly to this location, Dawlat will get an error message because
location is undefined inside the constructor.
So we have to initialize the location, property and everything inside of it.
In one easy way to do that is to say this location is going to be an object with Properties, Latt and
LNG.
Sunny side of here, we can once do again, do fakher dot address, dot lattitude.
Make sure you get the comma at the end of the line and then Fakher address dot longitude as well.
And once again.
Don't forget the parentheses.
All right, we're seeing the same as before.
We are trying to take a string because that is what we get back from Fakher in, assign it to a property
that's supposed to be a number.
So once again, we have to do a pass float.
And a float.
All right, so I think we're all set here.
We already got that export statement, so now we can import this entire index file, create an instance
of a company really quickly and just make sure everything works as expected.
So back inside of index inducts, I will import company from company.
And then underneath our user, I'll say company is going to be a new company like so.
And I'll do a council log of that company.
Then as a quick test, I'll flip back on my browser, my live reload already kicked in and I can see
that can't log right here.
So I'll expand company and I'll see that I've got a really great catch phrase, persistent directional
function.
And my company name is King Group.
Once again, really should not be calling that property company name.
Just name would be much more appropriate because we already know that it is a company we're working
with.
However, once again, we want to just differentiate the company from the user which had a name property.
And once again, I've got a location with the latitude and longitude as well.
All right, so that's pretty much it, we've created a class to represent our user and our company.
So let's take another quick pause right here.
When we come back, the next section, we're going to start working on getting a Google map to display
on our screen as well.
So I'll see you in just a minute.