Code Smarter !!

Sharing what I learn

Adding Twitter Bootstrap to an Angular 2 app - The Easy Way!

I needed to add Twitter Bootstrap (3) to one of my Angular 2.0 apps for a simple styling without jQuery part, but it wasn't as easy as what I thought!

I tried different approaches from adding Bootstrap to package.json and adding link tag for bootstrap css file in index.html, to installing ng-bootstrap, but none of them seemed to be working. Searching on the web also didn't give me any easy answer. Until I finally found the answer!

All I needed to do was to add a link tag to index.html pointing to the Twitter Bootstrap CDN! (copied from http://getbootstrap.com/getting-started/)

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

Hope this can save you a little time!

Happy coding...