angular-dropdown-element

0.0.3 • Public • Published

angular-dropdown-element

AngularElement dropdown

Demo

Installation

$ npm install angular-dropdown-element bootstrap

Usage

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Angular Dropdown Element</title>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
</head>

<body>
  <div class="container">
    <ng-dropdown-element label="name"></ng-dropdown-element>
  </div>
  <script src="node_modules/ng-dropdown-element/index.js"></script>
  <script>
    var items = Array.from({ length: 50 }, (e, i) => ({ name: 'test name ' + i }));
    const el = document.querySelector('ng-dropdown-element');
    el.items = items;

    el.addEventListener('valueChange', (e) => console.log(e.detail));
  </script>
</body>
</html>

Dropdown input/outputs

Input/Output Description
items array :-list of items
value any:- Dropdown value
label string or function:- used to get label value
placeholder string :- placeholder value. Default: 'Please select an item'
valueChange function:- gets called on value change.
itemRenderer function:- function to get html template for an item

/angular-dropdown-element/

    Package Sidebar

    Install

    npm i angular-dropdown-element

    Weekly Downloads

    1

    Version

    0.0.3

    License

    none

    Unpacked Size

    216 kB

    Total Files

    13

    Last publish

    Collaborators

    • akhlesh