1.0.0 • Published 2 years ago

ng2-material-dropdown v1.0.0

Weekly downloads
41,722
License
MIT
Repository
github
Last release
2 years ago

Angular2 Dropdown Component

Material-like dropdown component for Angular2.

Install

npm install ng2-material-dropdown --save

Usage

Once installed, import the directives and use it them your container component:

<ng2-dropdown>
    <ng2-dropdown-button>
        Open Menu
    </ng2-dropdown-button>
    <ng2-dropdown-menu>
        <ng2-menu-item *ngFor="let page of pages">
            {{ page }}
        </ng2-menu-item>

        <div class='ng2-menu-divider'></div>

        <ng2-menu-item>
            With Divider
        </ng2-menu-item>
    </ng2-dropdown-menu>
</ng2-dropdown>
// import module
import { Ng2DropdownModule } from 'ng2-material-dropdown';

@NgModule({
    imports: [ Ng2DropdownModule ]
    // ..
})
export class MyModule {}

API

ng2-dropdown

  • dynamicUpdate - [?boolean] : option to disable the dynamic update of the position on scroll events (defaults to true)
  • onItemSelected() - [(onItemSelected($event)] : event that emits the currently selected/hovered item
  • onItemClicked() - [(onItemClicked($event)] : event that emits the item clicked on
  • onShow() - [(onItemClicked($event)] : event that emits when the dropdown gets shown
  • onHide() - [(onItemClicked($event)] : event that emits when the dropdown gets hidden

ng2-dropdown-menu

  • focusFirstElement - [?boolean] : by default the first element is immediately focused. You can disable by setting this option to false
  • width - [?number]: this determines the width of the menu. Possible values are 2, 4 and 6. By default, this is set to 4
  • offset - [?string]: offset to adjust the position of the dropdown with absolute values
  • appendToBody - [?boolean] : by default the dropdown is appended to the body, but you can disable this by setting it to false

ng2-dropdown-button

  • showCaret - [?boolean] : if present, a caret will be appended to the button's text

ng2-menu-item

  • preventClose - [?boolean] : if present, this attribute prevents the menu to hide when the menu item is clicked
  • value - [?any] : any value that you may want to attach to a menu item. Useful for using this component with other components.
1.0.0

2 years ago

0.11.0

5 years ago

0.10.1

6 years ago

0.10.0

6 years ago

0.9.5

6 years ago

0.9.4-beta2

6 years ago

0.9.4-beta

6 years ago

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.8.2

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.10

7 years ago

0.7.9-beta-3

7 years ago

0.7.9-beta-2

7 years ago

0.7.9-beta

7 years ago

0.7.8

7 years ago

0.7.7

7 years ago

0.7.6

7 years ago

0.7.5

7 years ago

0.7.4

7 years ago

0.7.3

7 years ago

0.7.2

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.9

7 years ago

0.6.8

7 years ago

0.6.7

7 years ago

0.6.6

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.9

7 years ago

0.5.8

7 years ago

0.5.7

7 years ago

0.5.6

7 years ago

0.5.5

7 years ago

0.5.4

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.9

8 years ago

0.3.8

8 years ago

0.3.7

8 years ago

0.3.6

8 years ago

0.3.5

8 years ago

0.3.4

8 years ago

0.3.3

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.9

8 years ago

0.2.8

8 years ago

0.2.7

8 years ago

0.2.6

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago