Skip to content

mustafapsd/angularx-dropdown

Repository files navigation



This is a basic package for create dropdown with a simple directive

Links

Npm Link: angularx-dropdown

Demo Link: https://mustafapsd.github.io/angularx-dropdown


Usage

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

],

})

Example

<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>