diff --git a/README.md b/README.md index 7f8973b7e6..216a475bb7 100644 --- a/README.md +++ b/README.md @@ -35,35 +35,51 @@ Best way to quickly integrate Bootstrap 3 + Simple demo + +``` + +You will need bootstrap styles: +- `Bootstrap 3` ``` ``` -Or Bootstrap 4 +- `Bootstrap 4` ``` ``` -To enable bootstrap 4 theme templates in ngx-bootstrap, please read -[this](https://github.com/valor-software/ngx-bootstrap/blob/development/docs/getting-started/bootstrap4.md) . -# Usage & Demo +## Usage & Demo Main source of API documentation and usage scenarios available here: [https://valor-software.com/ngx-bootstrap/](https://valor-software.com/ngx-bootstrap/) @@ -73,36 +89,39 @@ Additionally you can find demos and docs deployed from latest code with here -# API +## API Check demo page for API [reference](https://valor-software.com/ngx-bootstrap/) -## How to use it with: - - `angular-cli` please refer to [getting-started-with-ng-cli](https://github.com/valor-software/ngx-bootstrap/tree/development/docs/getting-started/ng-cli.md) +### How to use it with: + - `Bootstrap 3 or 4 and angular-cli` please refer to [using-with-bootstrap-and-angular-cli](https://github.com/valor-software/ngx-bootstrap/tree/development/docs/getting-started/bootstrap.md) - `angular-seed` please refer to [getting-started-with-angular-seed](https://github.com/valor-software/ngx-bootstrap/tree/development/docs/getting-started/angular-seed.md) - `system.js` (and [angular2 quickstart](https://angular.io/docs/ts/latest/quickstart.html)) please checkout [sample repository](https://github.com/valor-software/angular2-quickstart) - - `plnkr` sample available [here](http://bit.ly/ngx-bootstrap-plnkr) + - `plnkr` sample available [here](https://plnkr.co/edit/0NipkZrnckZZROAcnjzB?p=preview) - `AoT using ngc and rollup` please refer to [ngx-bootstrap-with-aot](https://github.com/valor-software/ngx-bootstrap/tree/development/docs/getting-started/aot.md) - - `Bootstrap 4 and angular-cli` please refer to [using-with-bootstrap-4-and-angular-cli](https://github.com/valor-software/ngx-bootstrap/tree/development/docs/getting-started/bootstrap4.md) - `ASP.NET Core 2.0` please refer to [using-with-asp.net-core-2](https://github.com/csegyud/ASPNETCore_ngx-bootstrap_Sample/blob/master/README.md) -# How to build lib for development +### How to build lib for development -First time +First time: - clone repository - `npm install` - `npm run test` it will build the lib and create a link in `node_modules` +Keeping a fork up to date: + - git pull upstream development + - `npm run test` + To run bootstrap 3 and 4 demo: - `npm run demo.serve` to serve local demo. This is for testing only, without watchers. - For local development run + For local development run: - `npm run build.watch` in first terminal - `ng serve` in second If you want to run the demo with Angular Universal: - `npm run demo.serve-universal` -# Troubleshooting +## Troubleshooting So if you are in trouble, here's where you can look for help. @@ -111,16 +130,20 @@ You can also join [our Slack channel](https://ngx-slack.herokuapp.com/) and link If, **and only if**, none of the above helped, please open a [new issue](https://github.com/valor-software/ngx-bootstrap/issues/new). -# Contribution +## Contribution Are very welcome! And remember, contribution is not only PRs and code, but any help with docs or helping other developers to solve issues are very appreciated! Thanks in advance! Please read our [contribution guidelines](https://github.com/valor-software/ngx-bootstrap/blob/development/CONTRIBUTING.md). -## If you need more modules check [here](https://github.com/valor-software/ng2-plans) +### If you need more modules check [here](https://github.com/valor-software/ng2-plans) Please read central `ngx` modules [readme](https://github.com/valor-software/ng2-plans) for details, plans and approach -## Credits +### Credits Crossbrowser testing sponsored by [Browser Stack](https://www.browserstack.com) [Browser Stack](https://www.browserstack.com) + +### License + +MIT diff --git a/docs/getting-started/bootstrap4.md b/docs/getting-started/bootstrap.md similarity index 50% rename from docs/getting-started/bootstrap4.md rename to docs/getting-started/bootstrap.md index 719d5ad3b0..30d4253244 100644 --- a/docs/getting-started/bootstrap4.md +++ b/docs/getting-started/bootstrap.md @@ -1,15 +1,13 @@ -## Using with Bootstrap 4 with angular-cli +# Using with Bootstrap and angular-cli -This is extracted from the [angular-cli include bootstrap story](https://github.com/angular/angular-cli/wiki/stories-include-bootstrap) and demonstates one way to accomplish using Bootstrap 4 with ngx-bootstrap. +This is extracted from the [angular-cli include bootstrap story](https://github.com/angular/angular-cli/wiki/stories-include-bootstrap) and demonstates one way to accomplish using Bootstrap 3 or 4 with ngx-bootstrap. The `Bootstrap's` version is defined automatically by the `ngx-bootstrap`. -The important thing to note is the final section - you must let ngx-bootstrap know you are using Bootstrap 4 as it assumes BS3 by default. - -#### Installing angular-cli +## Installing angular-cli -*Important*: please check `angular-cli` version, it should be => "1.5.0" +*Important*: please check `angular-cli` version, it should be latest stable. *Note*: You can skip this part if you already have application generated by `ng-cli` and webpack. - + ```bash npm i -g @angular/cli ng new my-app @@ -17,42 +15,54 @@ cd my-app ng serve ``` -#### Adding ngx-bootstrap and Bootstrap 4 - - - install `ngx-bootstrap` and `Bootstrap 4` +## Adding ngx-bootstrap and Bootstrap + + - install `ngx-bootstrap` and `Bootstrap` ```bash - npm install ngx-bootstrap bootstrap --save + npm install ngx-bootstrap bootstrap --save ``` - -### Using with css -#### Configuring Project -Now that the project is set up it must be configured to include the Bootstrap CSS. +## Using with css +### Configuring Project - - Open the file .angular-cli.json from the root of your project. - - Under the property apps the first item in that array is the default application. - - There is a property styles which allows external global styles to be applied to your application. +Now that the project is set up it must be configured to include the Bootstrap CSS. You have two options: - - Specify the path to bootstrap.min.css + - add styles to .angular-cli.json: + - Open the file .angular-cli.json from the root of your project. + - Under the property apps the first item in that array is the default application. + - There is a property styles which allows external global styles to be applied to your application. - It should look like the following when you are done: -``` - "styles": [ - "../node_modules/bootstrap/dist/css/bootstrap.min.css", - "styles.css" + - Specify the path to bootstrap.min.css + + It should look like the following when you are done: + ``` + "styles": [ + "../node_modules/bootstrap/dist/css/bootstrap.min.css", + "styles.css" ], -``` - -Note: When you make changes to .angular-cli.json you will need to re-start ng serve to pick up configuration changes. + ``` + + Note: When you make changes to .angular-cli.json you will need to re-start ng serve to pick up configuration changes. + + - add styles to index.html: + - for Bootstrap 3: + ``` + + ``` + + - or for Bootstrap 4: + ``` + + ``` -### Using SASS +## Using SASS -#### Configuring Project +### Configuring Project Ensure that the project is set up to use scss by default and that the main styles file is styles.scss -The easiest way to do this is when creating a new project by +The easiest way to do this is when creating a new project by ```bash ng new my-app --style=scss cd my-app @@ -63,27 +73,26 @@ If the project has already been created then - rename `src/styles.css` to `src/styles.scss` - in `.angular-cli.json` make the following changes ``` - "styles": [ - "styles.scss" <-- rename this from .css to .scss - ], - . - . - . - "defaults": { - "styleExt": "scss", <-- set this to default to .scss - "component": {} - } +"styles": [ + "styles.css" <-- rename this from .css to .scss +], +. +. +. +"defaults": { + "styleExt": "css" <-- set this to default to .scss +} ``` Create an empty file `_variables.scss` in `src/`. In `styles.scss` add the following: ``` -@import 'variables'; +@import 'variables'; @import '../node_modules/bootstrap/scss/bootstrap'; ``` -### Testing +## Checkout Open `src/app/app.module.ts` and add @@ -94,7 +103,7 @@ import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; @NgModule({ ... imports: [BsDropdownModule.forRoot(), ... ], - ... + ... }) ```