I initially tried to set up ngx-bootstrap in Angular 2 by using the following command: npm install ngx-bootstrap bootstrap --save
Then, I included these lines in angular-cli.json:
"../node_modules/bootstrap/dist/css/bootstrap.min.css".
In app.component.html, I added the following code:
<div class="dropdown">
<a class="pull-right text-center btn btn-setting dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria- expanded="true"><i class="fa fa-cog"></i></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="menu1">
<li role="presentation"> <a role="menuitem" tabindex="-1" href="#" data-toggle="modal" data-target="#myModal"><i class="fa fa-cog"></i>Settings</a></li>
</ul>
</div>
Unfortunately, this code is not working for bootstrap dropdown menus. The dropdown menu is not functioning as expected. Please help.
My package.json file includes:
{
"name": "offline-new",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor"
},
"private": true,
"dependencies": {
(list of dependencies here)
},
"devDependencies": {
(list of devDependencies here)
}
}
Thanks