Inconsistent UI when using ngx-bootstrap and bootstrap 3
I found some inconsistency with some UI when integrating with ngx-bootstrap. I'm trying to use Bootstrap 3 with Angular + Electron. However, I found that the buttons in bootstrap don't have spacing between them and I'm not sure what is causing it. I tried to remove all CSS in any scss files found in your repo angular-electron but no visible changes.
Here's how it looks like:
To investigate, I followed ngx-bootstrap tutorial in using with Angular CLI. Starting from a new Angular project:
npm i -g @angular/cli
ng new my-app
cd my-app
ng serve
Install ngx-bootstrap and bootstrap 3:
npm install ngx-bootstrap bootstrap@3
Imported AlertModule from ngx-bootstrap into app.module.ts.
Added into .angular-cli.json
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.css",
],
And used the following into app.component.html
<div class="container">
<div class="row">
<div class="col-lg-12">
<alert type="success">hello</alert>
<button type="button" class="btn btn-default">button</button>
<button type="button" class="btn btn-primary">button</button>
<button type="button" class="btn btn-warning">button</button>
<button type="button" class="btn btn-default">button</button>
</div>
</div>
</div>
This is how it looks:
This version has spacing in between the buttons. So far I only see this inconsistency in the UI.
I have reflected similar actions and code to angular-electron but instead removed existing HTML in both app.component.html and home.component.html and added the above HTML code into both just to see if there are any changes but unfortunately, none.
I'm not sure what is causing this. Using Chrome inspect tool, I can't find any differences.
Well if there is no difference in inspect mode, I can't help you. I don't have time to install ngx-bootstrap on the project. The bug can be relevant to ngx-bootstrap. You can easily override the css.
I close the issue.
In src/app/main.ts change the line:
preserveWhitespaces: false
To:
preserveWhitespaces: true
I don't have time to explain why it works, but it works.