1
00:00:01,020 --> 00:00:03,480
All right, in this first section, what

2
00:00:03,480 --> 00:00:06,360
we're going to talk about is actually

3
00:00:06,360 --> 00:00:09,110
setting up modules. So in our browser,

4
00:00:09,110 --> 00:00:13,640
being able to use modules in our app.js.

5
00:00:13,640 --> 00:00:16,420
And the first thing we're going to look at

6
00:00:16,420 --> 00:00:19,170
when we're talking about setting things up

7
00:00:19,170 --> 00:00:20,790
in the browser is actually looking at

8
00:00:20,790 --> 00:00:23,150
browser compatibility for our import

9
00:00:23,150 --> 00:00:27,750
statement. And notice, Chrome, Edge,

10
00:00:27,750 --> 00:00:31,510
Firefox, Opera, Safari, all your web

11
00:00:31,510 --> 00:00:34,270
views, except for Samsung, they all work.

12
00:00:34,270 --> 00:00:36,680
Internet Explorer doesn't work, so you

13
00:00:36,680 --> 00:00:38,910
can't do modules in Internet Explorer, but

14
00:00:38,910 --> 00:00:42,140
all the rest of these browsers in a fairly

15
00:00:42,140 --> 00:00:45,430
up-to-date version are all going to work.

16
00:00:45,430 --> 00:00:47,570
So just make sure you've got a browser of

17
00:00:47,570 --> 00:00:52,640
this level and you should be ready to go.

18
00:00:52,640 --> 00:00:55,910
So if you go into your code in index.html

19
00:00:55,910 --> 00:00:58,000
in this app that we've been following

20
00:00:58,000 --> 00:01:00,110
along in, if you're just dropping in,

21
00:01:00,110 --> 00:01:02,060
that's fine. You don't have to follow

22
00:01:02,060 --> 00:01:04,540
along if you don't want to, but if you do,

23
00:01:04,540 --> 00:01:07,180
jump back a couple of modules and download

24
00:01:07,180 --> 00:01:11,200
our demo code from GitHub and follow along

25
00:01:11,200 --> 00:01:15,770
from there, but right here we have app.js

26
00:01:15,770 --> 00:01:19,070
and we want to convert app.js to be module

27
00:01:19,070 --> 00:01:23,740
based, not just our standard JavaScript

28
00:01:23,740 --> 00:01:26,300
style. So what we actually have to do is

29
00:01:26,300 --> 00:01:33,330
come in right here and say type=module,

30
00:01:33,330 --> 00:01:35,130
and what that's going to do is turn on

31
00:01:35,130 --> 00:01:39,170
modules for this piece and allow us to use

32
00:01:39,170 --> 00:01:41,680
the import and export statements inside

33
00:01:41,680 --> 00:01:43,050
JavaScript. If we don't have that

34
00:01:43,050 --> 00:01:46,160
type=module there, it doesn't work.

35
00:01:46,160 --> 00:01:48,030
Everything kind of falls apart. So this

36
00:01:48,030 --> 00:01:52,000
just lets the browser know that that's the type of thing that we're doing.

