Solvedangular cli angular-cli.json styles/scripts block do not load css/js file
✔️Accepted Answer
Try out my solution if it works fine for you:
npm install --save @ng-bootstrap bootstrap
then add the path in the styles array of .angular-cli.json an it will look likes this:
"styles": [ "styles.css", "../node_modules/bootstrap/dist/css/bootstrap.min.css" ]
after that stop the local server of your angular project and start it again, In simple words
restart the local server of the current angular project.
I hope this will work for you. Have a nice day :)
Other Answers:
Is there any ways to auto inject all the css files from a folder?
I am looking for something like in the .angular-cli.json
"styles": [ "styles.css", "./mystylesfolder/*.css" ],
or
"styles": [ "styles.css", "./mystylesfolder" ],
Getting the same trying to put ng2-bootstrap.
I can see the css of boostrap within the styles.bundle.js but not injected within my html.
Did someone has got a solution?
Thanks
OS?
angular-cli: 1.0.0-beta.18
node: 6.9.0
os: linux x64
Versions.
angular-cli: 1.0.0-beta.18
node: 6.9.0
os: linux x64
Repro steps.
add bootstrap css file like this
and run ng serve
all pass no error
style.bundle.js has load ,but not inject style element into HTML
The log given by the failure.
no error info
Mention any other details that might be useful.
same as scripts block
has load script.bundle.js but not work
If i remember correctly, beta17 still working