Skip to content

Instantly share code, notes, and snippets.

@erycamel
Last active July 11, 2018 04:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erycamel/3f6001209bd5e190e3b172db8cded2eb to your computer and use it in GitHub Desktop.
Save erycamel/3f6001209bd5e190e3b172db8cded2eb to your computer and use it in GitHub Desktop.
Angular 4 & Bootstrap 4 & FontAwesome & JQuery
Angular 4 & Bootstrap 4 & FontAwesome & JQuery
1. Install Bootstrap 4
As of now, Bootstrap 4 is still in alpha stage. This new version requires a newer version of jQuery as well as another component called tether.io which is used for the Bootstrap 4 Tooltips.
To install Bootstrap 4 and its dependencies, open up a terminal in your project’s base folder (where package.json is located) and execute the following commands:
npm install bootstrap@4.0.0-alpha.6 --save
npm install jquery@^3.2.1 --save
npm install tether@^1.4.0 --save
If you don’t see any error messages then you successfully installed all the required components. Now open your angular-cli.json file with your favorite text editor and add the highlighted entries:
{
"apps": [
{
"root": "src",
"outDir": "dist",
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
...
],
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/tether/dist/js/tether.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js",
...
],
...
}
],
...
}
Install Font Awesome
Installing Font Awesome is easier as it does not have any dependencies to 3rd party libraries.
So to install it you only need to execute the following in your project’s base folder:
npm install font-awesome --save
After successfull installation it is time to integrate it to your angular-cli.json file as well:
{
"apps": [
{
"root": "src",
"outDir": "dist",
"styles": [
"../node_modules/font-awesome/css/font-awesome.min.css",
...
],
...
}
],
"addons": [
"../node_modules/font-awesome/fonts/*.+(otf|eot|svg|ttf|woff|woff2)",
...
]
...
}
npm i -g npm-check-updates
npm-check-updates -u
npm install
@erycamel
Copy link
Author

erycamel commented Jun 7, 2017

ng set --global packageManager=yarn
yarn add bootstrap
yarn add font-awesome
yarn add jquery
yarn add tether

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment