I'm facing an issue with the ember-bootstrap plugin. I've downloaded and installed it, as it is mentioned on their setup page, written here: https://www.ember-bootstrap.com/getting-started/setup.
After the Setup, I have directly started with the Navbar - but not for long. The Hamburgermenu, to interact with the Navbar when collapsed didn't open. I found out that the bootstrap.min.js wasn't imported/loaded. Therefore, I've made an extra entry for the cdn that provides me the bootstrap.min.js, in the index file.
My Question is now, does the ember-bootstrap plugin provide this bootstrap.min.js and I've made a mistake or is this (only loading the js in the index file) already best practice?
ember-bootstrapis not using Bootstrap's JavaScript.Instead, it provides its own interactive components driven by Ember.
The collapsed/expanded state of the Navbar is governed by the
collapsedargument. This is an external value that is passed into the Navbar from the parent component like this:When the hamburger menu is clicked, the Navbar triggers the
onCollapseoronExpandaction. These actions should also be provided by the parent template:The official documentation for
ember-bootstrapNavbar takes a shortcut and does something like this instead:mutis an old feature of Ember, it lets you implement a Navbar in the parent template without writing anything in the parent JS file.PS The official documentation says
@collapsed={{true}}which is wrong. If you use a static value like this, you'll not be able to change the state. The demo behind the documentation actually uses@collapsed={{collapsed}}. According to modern Ember guidelines, it should be written as@collapsed={{this.collapsed}}.