Basically bootstrap()
in angular2 tell us about the entry point for an application with a very symmetry in ng-app
in angular 1.x, it creates an angular zone for the whole application, In angular 1. x we could use the ng-app
directive and give its value, for example ng-app="myApp"
, or use the angular.bootstrap method, which allows asynchronous loading.
The place required to load the bootstrap method is angular2 / platform / browser
import {bootstrap} from 'angular2/platform/browser'; ... Some Code stuff bootstrap(AppComponent, [Common providers, or Global services, varibale etc]);
We can also introduce GlobalServices, the variables that we are going to use throughout the application during the loading of our application, by doing this we do not want to import them again and again in our components.
source share