This question is very similar to my own, but I believe different enough (with version 2) to merit another.
What, specifically, does calling bootstrap()
do in an Angular 2 app? Can you explain in simple terms (like I'm 5)?
Lil Background
Angular 2 Quickstart contains the following main.js
(function(app) {
document.addEventListener('DOMContentLoaded', function() {
ng.platformBrowserDynamic.bootstrap(app.AppComponent);
});
})(window.app || (window.app = {}));
What I get:
I understand this code pretty well. I grok the scoping and event listening and all that, and I understand that bootstrapping is performed through one of a variety of libraries depending on the environment the app is running in, which is cool.
What I don't:
What is NOT explained is what, exactly, bootstrapping (line 3) is doing for/to my app. I've heard of it in other contexts as the first thing to run on an embedded system to gather all needed resources, and I understand how to use it in Angular 1 apps, but I've never had to call a bootstrap function like this.
Is it just attaching the backend to the DOM in a webapp? If so, what would it be doing in other contexts?