This is a basic package for create dropdown with a simple directive
Npm Link: angularx-dropdown
Demo Link: https://mustafapsd.github.io/angularx-dropdown
dropdownTemplate
This must be an ng-template
.
size
Dropdown container's size. sm: 230px (default) | md: 300px | lg: 400px
Default: sm
- Optional
classList
: string | string[]
- Optional
alignment
: left | right
Default: left
- Optional
disableCloseOnClickOutside
: boolean
Default: false
- Optional
app.module.ts
...
import { AngularxDropdownModule } from 'angularx-dropdown';
@NgModule({
imports: [
...
AngularxDropdownModule
],
})
<div>
<button
ngDropdown
[dropdownTemplate]="dropdownTemplate"
size="sm"
classList="custom-class"
>
Dropdown Button
</button>
<ng-template #dropdownTemplate>
Dropdown content
<button dropdown-close>
Custom Close Button
</button>
</ng-template>