System-wide config
Ember Basic Dropdown can take a fair amount of configuration options on invocations to alter its default behavior.
If you want all your dropdowns to behave on a certain way or have some certain classes? Repeating the same options over and over on your templates is boring.
If you want to apply a configuration option to all your dropdowns there is no special way
or key in the /config/environment.js
you need to learn.
Just use The Ember Way™.
Inside your app's /app/components
folder create a ember-basic-dropdown.js
file:
import EmberBasicDropdown from 'ember-basic-dropdown/components/basic-dropdown'; export default EmberBasicDropdown.extend({ // Place here your system-wide preferences triggerComponent: 'my-custom-trigger', calculatePosition() { // your custom function to position the dropdown } });
That's all. No new concepts to learn, just your usual ember-cli work flow.
In this example the component is also named {{basic-dropdown}}
but using this approach
you can create many components with different names that extend and customize the default one without
modifying it.