Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Date-picker styles not working after production build in Angular 4

recently I created a build of my Angular5 app in which I used ngx-bootstrap to show datepicker and modals. It was working very well before production, but after production, build seems like it lost its styling.

please check attached image...

enter image description here

I followed all the implementation steps again, but nothing worked.

Please help to resolve this issue. Thank you so much.

like image 828
vinayofficial Avatar asked Apr 17 '18 15:04

vinayofficial


Video Answer


2 Answers

Finally, I found a solution.

I just added ngx-bootstrap CSS into angular-cli.json

angular-cli.json

"styles": [
    "styles.css",
    "../node_modules/ngx-bootstrap/datepicker/bs-datepicker.css"],

and it worked for me. Thanks for attention.

like image 82
vinayofficial Avatar answered Sep 19 '22 14:09

vinayofficial


an other solution can solve your problem if the previous solution doesn't :

it's for :

"@angular/core": "^6.0.3", "@angular/material": "^7.3.2",

first add bs-datepicker.css path to angular.json file in the style paths :

"styles": [
    "styles.css",
    "../node_modules/ngx-bootstrap/datepicker/bs-datepicker.css"],

if you add bs-datepicker.css and still doesn't work try to add this link to your style.css

@import "~node_modules/ngx-bootstrap/datepicker/bs-datepicker.css";

enter image description here

that solved the problem for me hope it helps !

like image 23
nadir hamidou Avatar answered Sep 21 '22 14:09

nadir hamidou