Angular 6 - bootstrap navbar - toggle does not work


Angular 6 - bootstrap navbar - toggle does not work



I know this question is asked a lot here, but i still can not figure out how to make my bootstrap nav toggle without using ng-bootstrap. For now I only want to use jquery and popper.js.


<nav class="navbar navbar-expand-sm navbar-light bg-faded">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>


</nav>


"styles": [
"src/styles.scss"
],
"scripts": [
"../node_modules/jquery/dist/jquery.slim.min.js",
"../node_modules/popper.js/dist/umd/popper.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js"
],



And I imported the bootstrap styles in my global styles like that:


@import '../node_modules/bootstrap/dist/css/bootstrap.min.css';


"bootstrap": "^4.1.1",
"jquery": "^3.3.1",
"popper.js": "^1.14.3",





do you use cli???
– לבני מלכה
Jul 3 at 6:49





yeah as dev-dependency "@angular/compiler-cli": "^6.0.3",
– Hello_World
Jul 3 at 6:53


"@angular/compiler-cli": "^6.0.3",





and do you run command to install bootstrap??
– לבני מלכה
Jul 3 at 6:53





npm install bootstrap ???
– לבני מלכה
Jul 3 at 6:54


npm install bootstrap





try it in style.css:@import "~bootstrap/dist/css/bootstrap.css";
– לבני מלכה
Jul 3 at 6:54


@import "~bootstrap/dist/css/bootstrap.css";









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

api-platform.com Unable to generate an IRI for the item of type

How to set up datasource with Spring for HikariCP?

PHP contact form sending but not receiving emails