In this lecture, we're going to look at a platform for Angular before we can load angular, angular
is going to need a platform to run on.
Angular is an agnostic framework.
We can run it on browsers, mobile devices and on the desktop.
The Dev team designed Angular to run on various environments.
Our platform is a word to describe the environment Angular will run on.
Before we initialize our app, we need to provide a platform.
The job of the platform is to help angular understand the environment.
Therefore, we need to lower the platform first out of the box.
The angular team provides two platform functions for the browser.
There, the platform, browser and platform browser dynamic functions.
Both functions will allow Angular to run on the browser.
The difference between them is the compilation strategy.
The platform browser function will assume the compilation strategy is ahead of time compilation, whereas
the platform browser Dynamic Functions supports just in time compilation.
Overall, both functions have two jobs.
They will help angular understand the environment and compilation strategy.
We will be working inside the main doctor's file we emptied in an earlier lecture, as we discussed
before, we need to load a platform before loading Angular for this course.
We're going to develop apps for the browser.
The question is which function should we use?
The answer might be surprising.
We're going to use the platform browser dynamic function at the top of the file import, a function
called platform browser dynamic from a package called at angular platform browser dynamic.
Let's call it below the important statement.
As surprising as it might be, Angular will recommend this function over the platform browser function.
The angular Seelye comes with a few surprises before it builds our project.
It's going to check the compilation strategy.
By default, the Seelye assumes the strategy is ahead of time compilation if it finds the platform browser
dynamic function.
It'll override behavior of this function.
The inner mechanics of this function are swamped to support Aot compilation.
Jayate compilation is dropped.
Theoretically, it doesn't matter which function is imported.
The Seelye can handle choosing a compiler.
The angular team recommends this function if you ever decide to switch to Git compilation.
Congrats!
We've loaded a platform for angular.
It's as simple as that.
If we're using a compilation which we are, the framework will compile our code on the server.
If we have Git compilation turned on, compilation occurs on the browser.
In the next lecture, we're going to begin loading our app.