1
00:00:00,750 --> 00:00:04,860
Now that we've put our user together, we're going to repeat the same process and create a second file

2
00:00:04,980 --> 00:00:07,800
to represent a company inside of our application as well.

3
00:00:08,520 --> 00:00:14,730
So to get started inside of my SIRC directory, I'll make a new file called Company that's inside of

4
00:00:14,730 --> 00:00:14,820
you.

5
00:00:14,850 --> 00:00:20,700
I'm going to once again import the Fakher module from Fakher and I'll define a new class and immediately

6
00:00:20,700 --> 00:00:22,620
export it called company.

7
00:00:23,620 --> 00:00:27,090
So let's think about what different properties we might want a company to have.

8
00:00:27,820 --> 00:00:32,740
I think that maybe if you go back over to the documentation for Fakher one more time, remember, we

9
00:00:32,740 --> 00:00:37,480
have that company section, so we've got different properties in here like, say, company name and

10
00:00:37,480 --> 00:00:40,380
we've got catchphrase and some other stuff like that as well.

11
00:00:41,020 --> 00:00:43,930
So let's have every company have a company name, property.

12
00:00:44,050 --> 00:00:47,500
There will be a string and a catchphrase property that will be a string as well.

13
00:00:48,100 --> 00:00:53,530
In addition, will also have a company have a location that will be a latitude and longitude that's

14
00:00:53,530 --> 00:00:57,940
going to represent their physical location in the world so we can eventually represent them as a marker

15
00:00:57,940 --> 00:00:58,540
on our map.

16
00:00:59,490 --> 00:01:05,940
OK, so back over here, we'll do a company name that is a string and then we'll do a catchphrase.

17
00:01:07,550 --> 00:01:08,330
That is a string.

18
00:01:09,650 --> 00:01:15,860
We'll also do a location that's going to an object with a latitude property that is a number and a longitude

19
00:01:15,860 --> 00:01:17,410
property that is a number as well.

20
00:01:19,760 --> 00:01:24,800
Now, one thing I want to mention here is that calling the company name, company name is really not

21
00:01:24,800 --> 00:01:25,440
necessary.

22
00:01:25,820 --> 00:01:29,090
I think a much more ideal property name here would be name like so.

23
00:01:29,270 --> 00:01:34,040
But I just want to give it some differentiation from our user who had a name property as well.

24
00:01:34,910 --> 00:01:39,500
So just to make a little bit more stark difference between a company and a user, I'm going to have

25
00:01:39,500 --> 00:01:41,630
the company have a property of company name instead.

26
00:01:42,970 --> 00:01:46,360
All right, so now once again, we can define our constructor function, which is where we're going

27
00:01:46,360 --> 00:01:48,550
to initialize all those different properties.

28
00:01:49,240 --> 00:01:50,950
So I'll say this DOT company name.

29
00:01:53,280 --> 00:02:00,270
We'll be Fakher company, dot company name like, so let me collapse the sidebar so we can see that

30
00:02:00,270 --> 00:02:00,750
whole line.

31
00:02:04,750 --> 00:02:06,490
We can then do our catchphrase.

32
00:02:07,520 --> 00:02:10,699
Which will be Fakher company dot catchphrase.

33
00:02:12,340 --> 00:02:18,130
And then finally, we can also initialize our latitude and longitude as well, remember, like we just

34
00:02:18,130 --> 00:02:22,360
discussed, this right here does not initialize the location property.

35
00:02:22,360 --> 00:02:25,340
It just tells TypeScript here's what location will be.

36
00:02:25,720 --> 00:02:31,180
So if we try to assign a value directly to this location, Dawlat will get an error message because

37
00:02:31,180 --> 00:02:33,890
location is undefined inside the constructor.

38
00:02:34,660 --> 00:02:38,560
So we have to initialize the location, property and everything inside of it.

39
00:02:38,950 --> 00:02:46,660
In one easy way to do that is to say this location is going to be an object with Properties, Latt and

40
00:02:46,660 --> 00:02:47,260
LNG.

41
00:02:49,560 --> 00:02:54,840
Sunny side of here, we can once do again, do fakher dot address, dot lattitude.

42
00:02:55,740 --> 00:03:00,940
Make sure you get the comma at the end of the line and then Fakher address dot longitude as well.

43
00:03:00,960 --> 00:03:01,560
And once again.

44
00:03:02,900 --> 00:03:04,070
Don't forget the parentheses.

45
00:03:04,790 --> 00:03:07,160
All right, we're seeing the same as before.

46
00:03:07,310 --> 00:03:11,630
We are trying to take a string because that is what we get back from Fakher in, assign it to a property

47
00:03:11,630 --> 00:03:12,710
that's supposed to be a number.

48
00:03:13,220 --> 00:03:14,840
So once again, we have to do a pass float.

49
00:03:18,070 --> 00:03:19,600
And a float.

50
00:03:25,580 --> 00:03:27,300
All right, so I think we're all set here.

51
00:03:27,320 --> 00:03:32,600
We already got that export statement, so now we can import this entire index file, create an instance

52
00:03:32,600 --> 00:03:35,890
of a company really quickly and just make sure everything works as expected.

53
00:03:36,420 --> 00:03:42,050
So back inside of index inducts, I will import company from company.

54
00:03:43,400 --> 00:03:48,860
And then underneath our user, I'll say company is going to be a new company like so.

55
00:03:50,190 --> 00:03:53,010
And I'll do a council log of that company.

56
00:03:56,830 --> 00:04:00,970
Then as a quick test, I'll flip back on my browser, my live reload already kicked in and I can see

57
00:04:00,970 --> 00:04:02,470
that can't log right here.

58
00:04:03,100 --> 00:04:08,440
So I'll expand company and I'll see that I've got a really great catch phrase, persistent directional

59
00:04:08,440 --> 00:04:08,970
function.

60
00:04:09,130 --> 00:04:10,720
And my company name is King Group.

61
00:04:10,720 --> 00:04:14,650
Once again, really should not be calling that property company name.

62
00:04:14,860 --> 00:04:18,670
Just name would be much more appropriate because we already know that it is a company we're working

63
00:04:18,670 --> 00:04:18,970
with.

64
00:04:19,630 --> 00:04:23,620
However, once again, we want to just differentiate the company from the user which had a name property.

65
00:04:24,650 --> 00:04:27,920
And once again, I've got a location with the latitude and longitude as well.

66
00:04:28,810 --> 00:04:33,240
All right, so that's pretty much it, we've created a class to represent our user and our company.

67
00:04:33,880 --> 00:04:35,380
So let's take another quick pause right here.

68
00:04:35,380 --> 00:04:39,430
When we come back, the next section, we're going to start working on getting a Google map to display

69
00:04:39,430 --> 00:04:40,300
on our screen as well.

70
00:04:40,640 --> 00:04:42,060
So I'll see you in just a minute.

