@@ -46,6 +46,7 @@ The generated project has dependencies that require **Node 4 or greater**.
46
46
* [ Commands autocompletion] ( #commands-autocompletion )
47
47
* [ CSS preprocessor integration] ( #css-preprocessor-integration )
48
48
* [ 3rd Party Library Installation] ( #3rd-party-library-installation )
49
+ * [ Global Library Installation] ( #global-library-installation )
49
50
* [ Updating angular-cli] ( #updating-angular-cli )
50
51
* [ Known Issues] ( #known-issues )
51
52
* [ Development Hints for hacking on angular-cli] ( #development-hints-for-hacking-on-angular-cli )
@@ -287,6 +288,34 @@ npm install moment --save
287
288
npm install @types/moment --save-dev
288
289
```
289
290
291
+ ### Global Library Installation
292
+
293
+ Some javascript libraries need to be added to the global scope, as if they were
294
+ loaded via a script tag. We can do this by manually adding these libraries to ` window ` .
295
+
296
+ As an example, to install Boostrap 4 this is what you need to do:
297
+
298
+ First install the needed libraries from ` npm ` :
299
+
300
+ ``` bash
301
+ npm install jquery tether bootstrap@next
302
+ ```
303
+
304
+ Then update ` styles.css ` by importing the ` Bootstrap ` styles:
305
+ ```
306
+ @import '../node_modules/bootstrap/dist/css/bootstrap.css';
307
+ ```
308
+
309
+ Then add the following to ` src/scripts.ts ` .
310
+
311
+ ```
312
+ window['jQuery'] = require('jquery')
313
+ window['Tether'] = require('tether')
314
+ require('bootstrap/dist/js/bootstrap');
315
+ ```
316
+
317
+ Now Bootstrap 4 should be working on your app.
318
+
290
319
### Updating angular-cli
291
320
292
321
To update ` angular-cli ` to a new version, you must update both the global package and your project's local package.
0 commit comments