npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-select-option

v3.0.4

Published

Select directive for angular 1.x

Downloads

8

Readme

Build Status

angular-select

Angular Select is a responsive and customizable select for angular 1.x. A simple directive along with a configuration object and you're ready to go. Demo

Installation with npm

npm install angular-select-option --save

How to use:

Method 1: import scripts in your html and the directive as a module dependency:

<!-- You can choose umd format -->
<script src="<your-node-module-path>/dist/angular-select-umd.min.js"></script>

<!-- Or you can choose es6 module. Don't forget type=module -->
<script type="module" src="<your-node-module-path>/angular-select-option/src/lib/angular-select.js"></script>
angular.module('myApp', ['angular-select']);

Method 2: import all scripts from node_modules and use it as module dependency (see the demo folder):

import angular from 'angular';
import angularSelect from 'angular-select-option/lib/angular-select'; 

angular.module('myApp', ['angular-select']);

The CSS

You can choose between the scss or che css version. Choosing SASS allow you to specify some graphic behaviour overriding the global variables in angular-select.scss file

// default settings
$max-width:       none!default;
$select-height:   45px!default;
$header-color:    #37474f!default;
$arrow-bg:        #0080ff!default;
$arrow-fill:      #ffffff!default;
$arrow-width:     32px!default;
$header-bg:       #ffffff!default;
$options-bg:      #fafafa!default;
$options-color:   #37474f!default;
$options-shadow:  0 5px 10px -4px rgba(0, 0, 0, .36)!default;

Custom Atribute

these are the custom attributes available

scope: {
  selectoptionName: "@", //name to display above the select
  selectoptionModel: "=", //model to bind the selected value
  selectoptionElements: "=", //list of the options
  selectoptionCallback: "&?", //callback to be triggered on click
  selectoptionRequired: "=?", //if the select is required e.g. inside a form
  selectoptionOrderby: "@?" //order to display the elements
},

Usage

A simple example available in /demo folder

<form name="formName" novalidate>
  <span ng-if="formName.$submitted && formName.countries.$error.required">Required</span>
  <select-option
    selectoption-name="countries"
    selectoption-model="formData.countries"
    selectoption-elements="countries"
    selectoption-callback="countriesCallback(index)"        
    selectoption-required="true"
    selectoption-orderby="desc">
  </select-option>
  <button type="submit" class="btn btn-primary">Send</button>
</form>
// Form Model
$scope.formData = {};

// Countries Data
$scope.countries = {
  title: 'Nation',
  items : [
    {label: 'France', value: 'FR'},
    {label: 'England', value: 'UK'},
    {label: 'Germany', value: 'DE'}
  ]
};

// Countries Callback
$scope.countriesCallback = function (index) {
  $scope.callbackResult = index;
};

How to run local npm scripts

 // Run local dev server on demo folder
 npm run serve

 // Start demo build process. Create demo folder inside dist.
 npm run build:demo

 // Export minified lib in UMD and ESM format inside dist folder.
 npm run build:lib

 // Serve build demo inside dist folder
 npm run serve:build-demo