After experimenting with various solutions, I finally found success with the helpful advice from @Gajanan. I am sharing this for my future self or anyone else who may come across the same issue. It's actually quite simple and could be easily found in either the Bootstrap documentation or the Angular documentation.
Here is the step-by-step process I followed:
- Started a new Angular project from the cli, using scss and TypeScript.
- Downloaded Bootstrap using NPM.
- Added the Bootstrap
.scss
file to the default styles scss.
Initially, everything seemed fine as the Bootstrap styles loaded correctly. However, when I tried to use the modal, it didn't work as expected. Thanks to @Gajanan's solution, I was able to resolve the issue.
One additional tip to keep in mind is to ensure that you add the script in the correct location. I made the mistake of adding it elsewhere, wasting about 15 minutes in the process.
{
...
"projects": {
...
"myProject": {
...
"architect": {
...
"build": {
...
"options": {
...
"scripts": ["here 🎉"],
},
...
"test": {
...
"options": {
...
"scripts": ["NOT here"],
}
}
}
}
}
}
}
I know it may seem obvious, but I learned my lesson the hard way. Consider this my way of reminding myself not to make that mistake again.