1 00:00:00,150 --> 00:00:04,380 In this lecture, we will move on to the next step, which is to load our app. 2 00:00:04,710 --> 00:00:08,880 We are going to continue working inside the main doctors file. 3 00:00:09,150 --> 00:00:14,070 From the previous lecture, we called the platform browser dynamic function. 4 00:00:14,430 --> 00:00:21,960 This function returns an object called a platform reference platform references how functions for initializing 5 00:00:21,960 --> 00:00:22,500 our app. 6 00:00:22,830 --> 00:00:29,940 After calling the platform browser dynamic function, we will immediately chain a function called bootstrap 7 00:00:29,940 --> 00:00:30,570 module. 8 00:00:33,150 --> 00:00:36,150 We haven't had an opportunity to talk about modules. 9 00:00:36,390 --> 00:00:39,330 We will be talking about modules in a future lecture. 10 00:00:39,630 --> 00:00:43,950 The job of the module is to glue our app together, as you can see. 11 00:00:43,980 --> 00:00:46,890 We have dozens of files in the source directory. 12 00:00:47,220 --> 00:00:49,290 Not to mention angular features. 13 00:00:49,590 --> 00:00:53,970 We need to load a module that will be responsible for gluing everything together. 14 00:00:54,600 --> 00:00:59,610 Luckily, the Seelye has provided us with a module for bringing everything together. 15 00:00:59,940 --> 00:01:05,580 There's only one module in our project inside the source slash app directory. 16 00:01:05,820 --> 00:01:09,630 We have a file called App Module Acts. 17 00:01:10,020 --> 00:01:12,750 This file contains the code for starting our app. 18 00:01:13,080 --> 00:01:14,790 Let's import it at the top. 19 00:01:21,340 --> 00:01:24,940 Next, we will pass it into the bootstrap module function. 20 00:01:27,430 --> 00:01:31,660 The bootstrap module function will initiate our app in the browser. 21 00:01:31,930 --> 00:01:33,100 We're almost finished. 22 00:01:33,280 --> 00:01:34,690 There's one last step. 23 00:01:35,080 --> 00:01:41,740 The bootstrap module function will return a promise we should make sure to log any errors produced by 24 00:01:41,740 --> 00:01:43,210 Angular or our app. 25 00:01:43,570 --> 00:01:45,460 Let's change the catch function. 26 00:01:48,050 --> 00:01:52,220 We will pass in an arrow function with an argument to accept the error message. 27 00:01:54,660 --> 00:01:59,370 Lastly, we will log the error message with the console error function. 28 00:02:01,840 --> 00:02:02,650 We're finished. 29 00:02:02,860 --> 00:02:05,410 Let's check if our app is working in the browser. 30 00:02:07,950 --> 00:02:08,400 Great. 31 00:02:08,520 --> 00:02:11,220 We've got the same functioning app we had before. 32 00:02:11,550 --> 00:02:14,910 Hopefully, you have a better understanding of what's going on. 33 00:02:15,210 --> 00:02:19,650 Just in case, let me summarize what's happening in the simplest way I can. 34 00:02:19,950 --> 00:02:22,890 Back in our editors, we have two functions. 35 00:02:24,110 --> 00:02:29,600 The platform Browse for Dynamic Function, will load an object with information on the current platform. 36 00:02:29,870 --> 00:02:32,510 In this case, the platform is the browser. 37 00:02:32,780 --> 00:02:36,950 The bootstrap module function will load our app and angular features. 38 00:02:37,190 --> 00:02:38,930 We must load them in this order. 39 00:02:39,200 --> 00:02:40,970 That's the gist of what's going on. 40 00:02:41,420 --> 00:02:43,190 We're not done with the file yet. 41 00:02:43,400 --> 00:02:46,490 We will make one more improvements in the next lecture.