Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does it mean to "bootstrap" an Angular application?

Tags:

angular

There are a number of places in the Angular docs where the word "bootstrap" appears as a link. The link takes you here.

I don't see anything in the linked section that actually says what the word "bootstrap" means. As far as I can tell it's just a synonym for "start", but I don't know if I'm right about that.

I know that you can do something like platformBrowserDynamic().bootstrapModule(AppModule); and it will "bootstrap" your app using the AppModule. That doesn't really tell me the meaning of the word, though.

So what does bootstrap mean, exactly?

like image 523
Jason Swett Avatar asked May 19 '17 18:05

Jason Swett


People also ask

How is Angular bootstrapping done?

The application launches by bootstrapping the root AppModule , which is also referred to as an entryComponent . Among other things, the bootstrapping process creates the component(s) listed in the bootstrap array and inserts each one into the browser DOM.

Do we need bootstrap in Angular?

Yes, you can use parts of Angular Material and Bootstrap together in the same web or mobile project. Developers need to be careful not to use the same components, which can clash. Angular Material and Bootstrap offer a variety of unique components for great website design.

How do I add bootstrap to Angular app?

Adding bootstrap using the angular. Open the file and perform the following commands, node_modules/bootstrap/dist/css/bootstrap. css in the projects->architect->build->styles array, node_modules/bootstrap/dist/js/bootstrap. js in the projects->architect->build->scripts array, node_modules/bootstrap/dist/js/bootstrap.

Which file is responsible for bootstrapping an Angular app?

When Angular launches the app, it places the HTML rendering of AppComponent in the DOM, inside the element tags of the index. html. You launch the application by bootstrapping the AppModule in the main. ts file.


2 Answers

The bootstrapping process sets up the execution environment, digs the root AppComponent out of the module's bootstrap array, creates an instance of the component and inserts it within the element tag identified by the component's selector.

enter image description here

like image 124
yurzui Avatar answered Sep 30 '22 15:09

yurzui


I, too, had this question because I had forgotten what it means. I was getting especially confused with the Bootstrap CSS framework. Your original question asked the meaning from a more general meaning, and not just with respect to Angular.

Bootstrapping is actually an old computer term and I think Wikipedia's definition is decent:

In general, bootstrapping usually refers to a self-starting process that is supposed to proceed without external input. In computer technology the term (usually shortened to booting) usually refers to the process of loading the basic software into the memory of a computer after power-on or general reset, especially the operating system which will then take care of loading other software as needed.

The term appears to have originated in the early 19th-century United States (particularly in the phrase "pull oneself over a fence by one's bootstraps") to mean an absurdly impossible action, an adynaton.

like image 25
Tom Hoffman Avatar answered Sep 30 '22 15:09

Tom Hoffman