在Angular中安装Bootstrap可以按照以下步骤进行:
npm install bootstrap jquery --save
"node_modules/bootstrap/dist/css/bootstrap.min.css"
将以下代码添加到"scripts"数组中:
"node_modules/jquery/dist/jquery.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js"
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'bootstrap';
import 'jquery';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Hello, Bootstrap!
这样就可以在Angular中成功安装并使用Bootstrap了。