角度とブートストラップ3の両方を統合する標準的な方法は何ですか?角度2 +ブートストラップ3
私のプロジェクトのindex.htmlファイルにjsファイルを直接追加できますか?
また、ブートストラップ4安定版もリリースされていません。だから私は自分のプロジェクトでそれを使いたくない。これに関するあなたの入力を提供してください。
角度とブートストラップ3の両方を統合する標準的な方法は何ですか?角度2 +ブートストラップ3
私のプロジェクトのindex.htmlファイルにjsファイルを直接追加できますか?
また、ブートストラップ4安定版もリリースされていません。だから私は自分のプロジェクトでそれを使いたくない。これに関するあなたの入力を提供してください。
あなたは、2つの配列を持っています。静的ファイルをそこに追加することができます(index.html
内でこれを行う必要はありません)。このよう
:
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js"
]
はいできます。あなたのsrc
フォルダ
assets
> boostrap
ドロップそのフォルダ内のbootstrap.min.css
とbootstrap.min.js
に次のようなフォルダ構造を作成します。
次にindex.html
に、あなたは道以下<head></head>
内にそれらを追加することができます。
<head>
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<script src="assets/js/bootstrap.min.js"></script>
</head>
あなたがCDNを使用する場合は、あなただけの<head></head>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
内のリンクを入れて、任意のフォルダを作成する必要はありません。
angular-cli
を使用している場合は、ブートストラップ用のnpmパッケージがあります。.angular-cli.json
に対応するcssファイルとjsファイルをscripts
とに追加するだけですセクション。 styles
とscripts
:
チェック.angular-cli.json
以内https://www.npmjs.com/package/angular-cli#global-library-installation
あなたの助けをありがとう – user8148246