New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

ng2-material-dropdown

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng2-material-dropdown

Angular 2 material-like Dropdown Component

0.0.3
Version published
Weekly downloads
29K
-19.87%
Maintainers
1
Weekly downloads
 
Created

Angular2 Dropdown Component

Material-like dropdown component for Angular2.

Work in progress

Install

npm install ng2-material-dropdown --save

Demo

TODO

Usage

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

// example.html
<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>
        
        <ng2-menu-divider></ng2-menu-divider>
        
        <ng2-menu-item>
            With Divider
        </ng2-menu-item>
    </ng2-dropdown-menu>
</ng2-dropdown>

// app.ts
// import all needed directives
import { NG2_DROPDOWN_DIRECTIVES } from 'ng2-material-dropdown';

@Component({
    selector: 'app',
    directives: [ ...NG2_DROPDOWN_DIRECTIVES ],
    template: require('./example.html')
})

export class App {
    pages = ['Home', 'Explore', 'Help'];
}

API

ng2-menu-item

preventClose - [?boolean] : if present, this attribute prevents the menu to hide when the menu item is clicked

FAQs

Package last updated on 05 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts