In this lecture, we will move on to the next step, which is to load our app.
We are going to continue working inside the main doctors file.
From the previous lecture, we called the platform browser dynamic function.
This function returns an object called a platform reference platform references how functions for initializing
our app.
After calling the platform browser dynamic function, we will immediately chain a function called bootstrap
module.
We haven't had an opportunity to talk about modules.
We will be talking about modules in a future lecture.
The job of the module is to glue our app together, as you can see.
We have dozens of files in the source directory.
Not to mention angular features.
We need to load a module that will be responsible for gluing everything together.
Luckily, the Seelye has provided us with a module for bringing everything together.
There's only one module in our project inside the source slash app directory.
We have a file called App Module Acts.
This file contains the code for starting our app.
Let's import it at the top.
Next, we will pass it into the bootstrap module function.
The bootstrap module function will initiate our app in the browser.
We're almost finished.
There's one last step.
The bootstrap module function will return a promise we should make sure to log any errors produced by
Angular or our app.
Let's change the catch function.
We will pass in an arrow function with an argument to accept the error message.
Lastly, we will log the error message with the console error function.
We're finished.
Let's check if our app is working in the browser.
Great.
We've got the same functioning app we had before.
Hopefully, you have a better understanding of what's going on.
Just in case, let me summarize what's happening in the simplest way I can.
Back in our editors, we have two functions.
The platform Browse for Dynamic Function, will load an object with information on the current platform.
In this case, the platform is the browser.
The bootstrap module function will load our app and angular features.
We must load them in this order.
That's the gist of what's going on.
We're not done with the file yet.
We will make one more improvements in the next lecture.