1

I started a new angular 2 project with ng-bootstrap. I can see the bootstrap js working fine, but not the CSS. Do I need to include those CSS explicitly, which I doubt would be the case, but I may be wrong too.

I even tried adding the bootstrap.css in my component, but nothing happened. Adding it on index.html does make the difference but I didn't want to call explicitly unless there is no other way.

Thanks,

2
  • Are you using angular-cli ? Commented Mar 28, 2017 at 8:01
  • yes, I installed through ng-bootstrap.github.io/#/getting-started, and starting the server through ng serve Commented Mar 28, 2017 at 8:14

2 Answers 2

2

Glyphicon are no longer supported in Bootstrap 4, so missing fonts were the root cause rather than css.

Dropped the Glyphicons icon font. If you need icons, some options are: the upstream version of Glyphicons Octicons Font Awesome

src: https://v4-alpha.getbootstrap.com/migration/

Sign up to request clarification or add additional context in comments.

1 Comment

Don't forget to accept your own answer, it could help others who stumble upon the same problem.
1

Since you are using angular-cli you can add the path to your global css files in the angular-cli.json file to add it globally:

"styles": [
   "../node_modules/path/to/bootstrap.css",
   "styles.css"
]

8 Comments

It didn't bring any style in my code: <i class="glyphicon glyphicon-heart" [class.highlighted]="iLike" (click)="click()"> </i>
And it also overwrite my existing style, so it is pulling the css. It might be the case that probably glyphicon would be missing into it.
you're probably missing the font not the CSS
But I didn't found any font in bootstrap, do we have manually include it somewhere?
No, they comme with the bootstrap module : imgur.com/GDZxaaN Did you npm install bootstrap ? If I'm not mistaking ng2-bootstrap contains only the components not the css files.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.