Reputation: 57
I am trying to remove bootstrap from my angular 6 project so I can replace it with angular material. I tried running npm uninstall bootstrap --no-save
, then in app.module.ts, I commented out the bootstrap line:
...
exports: [],
providers: [StudentService, EmailService, UploadFileService, StudentListComponent, EmailComponent, AddStudentComponent],
// bootstrap: [AppComponent]
Finally, in main.ts, I commented out the bootstrap related line:
...
if (environment.production) {
enableProdMode();
}
// platformBrowserDynamic().bootstrapModule(AppModule)
// .catch(err => console.log(err));
Once this is done, I try to load my app, and I get no errors in the console, but the project is stuck on "loading" and no components appear. Any help on this would be awesome!
Upvotes: 0
Views: 4268
Reputation: 306
There is nothing to do with bootstrap in AppComponent.ts and bootstrapModule in main.ts files, you need to just uninstall bootstrap from your project and install angular-material and reload the App!
Upvotes: 0
Reputation: 981
Angular does not use bootstrap (the CSS framework). The line you commented out is an important part of the application. From Wikipedia: In computing, a bootstrap loader is the first piece of code that runs when a machine starts, and is responsible for loading the rest of the operating system.
So bootstrap: [ AppComponent ]
is just telling Angular to load that component first.
Upvotes: 1
Reputation: 732
Quick Answer:
The lines that you commented out are actually part of Angular, not the Bootstrap UI framework. I know the naming conventions can get confusion with so much going on, but you actually want to keep those in there. They're "boostrapping" the application together, not doing anything with bootstrap
, if that makes sense.
You should be able to uncomment those lines and everything should work as normal.
Upvotes: 1