1 00:00:00,120 --> 00:00:05,790 In this lecture, we're going to look at a platform for Angular before we can load angular, angular 2 00:00:05,790 --> 00:00:07,830 is going to need a platform to run on. 3 00:00:08,250 --> 00:00:10,350 Angular is an agnostic framework. 4 00:00:10,560 --> 00:00:14,340 We can run it on browsers, mobile devices and on the desktop. 5 00:00:14,640 --> 00:00:18,780 The Dev team designed Angular to run on various environments. 6 00:00:19,350 --> 00:00:23,190 Our platform is a word to describe the environment Angular will run on. 7 00:00:23,760 --> 00:00:27,330 Before we initialize our app, we need to provide a platform. 8 00:00:27,600 --> 00:00:31,620 The job of the platform is to help angular understand the environment. 9 00:00:31,830 --> 00:00:36,240 Therefore, we need to lower the platform first out of the box. 10 00:00:36,540 --> 00:00:40,170 The angular team provides two platform functions for the browser. 11 00:00:40,380 --> 00:00:44,760 There, the platform, browser and platform browser dynamic functions. 12 00:00:45,030 --> 00:00:48,180 Both functions will allow Angular to run on the browser. 13 00:00:48,450 --> 00:00:51,660 The difference between them is the compilation strategy. 14 00:00:52,230 --> 00:00:58,500 The platform browser function will assume the compilation strategy is ahead of time compilation, whereas 15 00:00:58,500 --> 00:01:03,030 the platform browser Dynamic Functions supports just in time compilation. 16 00:01:03,450 --> 00:01:06,180 Overall, both functions have two jobs. 17 00:01:06,450 --> 00:01:10,890 They will help angular understand the environment and compilation strategy. 18 00:01:12,880 --> 00:01:18,970 We will be working inside the main doctor's file we emptied in an earlier lecture, as we discussed 19 00:01:18,970 --> 00:01:23,680 before, we need to load a platform before loading Angular for this course. 20 00:01:23,740 --> 00:01:26,050 We're going to develop apps for the browser. 21 00:01:26,530 --> 00:01:29,260 The question is which function should we use? 22 00:01:29,740 --> 00:01:31,540 The answer might be surprising. 23 00:01:31,750 --> 00:01:37,900 We're going to use the platform browser dynamic function at the top of the file import, a function 24 00:01:37,900 --> 00:01:44,860 called platform browser dynamic from a package called at angular platform browser dynamic. 25 00:01:47,410 --> 00:01:49,780 Let's call it below the important statement. 26 00:01:52,330 --> 00:01:58,150 As surprising as it might be, Angular will recommend this function over the platform browser function. 27 00:01:58,510 --> 00:02:03,410 The angular Seelye comes with a few surprises before it builds our project. 28 00:02:03,430 --> 00:02:05,920 It's going to check the compilation strategy. 29 00:02:06,190 --> 00:02:13,710 By default, the Seelye assumes the strategy is ahead of time compilation if it finds the platform browser 30 00:02:13,720 --> 00:02:14,860 dynamic function. 31 00:02:15,040 --> 00:02:17,560 It'll override behavior of this function. 32 00:02:18,190 --> 00:02:22,870 The inner mechanics of this function are swamped to support Aot compilation. 33 00:02:23,260 --> 00:02:25,300 Jayate compilation is dropped. 34 00:02:25,540 --> 00:02:29,170 Theoretically, it doesn't matter which function is imported. 35 00:02:29,500 --> 00:02:32,110 The Seelye can handle choosing a compiler. 36 00:02:32,440 --> 00:02:38,050 The angular team recommends this function if you ever decide to switch to Git compilation. 37 00:02:38,650 --> 00:02:39,340 Congrats! 38 00:02:39,520 --> 00:02:41,500 We've loaded a platform for angular. 39 00:02:41,710 --> 00:02:43,060 It's as simple as that. 40 00:02:43,360 --> 00:02:49,450 If we're using a compilation which we are, the framework will compile our code on the server. 41 00:02:49,990 --> 00:02:55,000 If we have Git compilation turned on, compilation occurs on the browser. 42 00:02:55,300 --> 00:02:58,570 In the next lecture, we're going to begin loading our app.