0.0.3 • Published 5 years ago

angular-dropdown-element v0.0.3

Weekly downloads
9
License
-
Repository
github
Last release
5 years ago

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/OutputDescription
itemsarray :-list of items
valueany:- Dropdown value
labelstring or function:- used to get label value
placeholderstring :- placeholder value. Default: 'Please select an item'
valueChangefunction:- gets called on value change.
itemRendererfunction:- function to get html template for an item