diff --git a/docs/documentation/stories/global-lib.md b/docs/documentation/stories/global-lib.md index 91c621acfd5c..74f1f3a64587 100644 --- a/docs/documentation/stories/global-lib.md +++ b/docs/documentation/stories/global-lib.md @@ -1,37 +1,36 @@ # Global Library Installation -Some javascript libraries need to be added to the global scope, and loaded as if -they were in a script tag. We can do this using the `apps[0].scripts` and -`apps[0].styles` properties of `.angular-cli.json`. +Some javascript libraries need to be added to the global scope and loaded as if +they were in a script tag. +We can do this using the `scripts` and `styles` options of the build target in `angular.json`. -As an example, to use [Bootstrap 4](https://getbootstrap.com/docs/4.0/getting-started/introduction/) this is -what you need to do: +As an example, to use [Bootstrap 4](https://getbootstrap.com/docs/4.0/getting-started/introduction/) +this is what you need to do: First install Bootstrap from `npm`: ```bash npm install jquery --save npm install popper.js --save -npm install bootstrap@next --save +npm install bootstrap --save ``` -Then add the needed script files to `apps[0].scripts`: +Then add the needed script files to `scripts`: ```json "scripts": [ - "../node_modules/jquery/dist/jquery.slim.js", - "../node_modules/popper.js/dist/umd/popper.js", - "../node_modules/bootstrap/dist/js/bootstrap.js" + "node_modules/jquery/dist/jquery.slim.js", + "node_modules/popper.js/dist/umd/popper.js", + "node_modules/bootstrap/dist/js/bootstrap.js" ], ``` -Finally add the Bootstrap CSS to the `apps[0].styles` array: +Finally add the Bootstrap CSS to the `styles` array: ```json "styles": [ - "../node_modules/bootstrap/dist/css/bootstrap.css", - "styles.css" + "node_modules/bootstrap/dist/css/bootstrap.css", + "src/styles.css" ], ``` -Restart `ng serve` if you're running it, and Bootstrap 4 should be working on -your app. +Restart `ng serve` if you're running it, and Bootstrap 4 should be working on your app. diff --git a/docs/documentation/stories/global-scripts.md b/docs/documentation/stories/global-scripts.md index fe12d7473e03..c67a052629f3 100644 --- a/docs/documentation/stories/global-scripts.md +++ b/docs/documentation/stories/global-scripts.md @@ -1,32 +1,38 @@ # Global scripts -You can add Javascript files to the global scope via the `apps[0].scripts` -property in `.angular-cli.json`. +You can add Javascript files to the global scope via the `scripts` option inside your +project's build target options in `angular.json`. These will be loaded exactly as if you had added them in a `