AngularJS进阶(五)Angular实现下拉菜单多选

AngularJS进阶(五)Angular实现下拉菜单多选Angular实现下拉菜单多选写这篇文章时,引用文章地址如下:http://ngmodules.org/modules/angularjs-dropdown-multiselecthttp://dotansimha.github.io/angularjs-dropdown-multiselect/#/AngularJSDropdownMultiselectThisdire

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

Angular实现下拉菜单多选

写这篇文章时,引用文章地址如下:

http://ngmodules.org/modules/angularjs-dropdown-multiselect

http://dotansimha.github.io/angularjs-dropdown-multiselect/#/

AngularJS Dropdown Multiselect

This directive gives you a Bootstrap Dropdown with the power of AngularJS directives.

Features

Based on Bootstrap’s dropdown.

jQuery is not necessary.

Seperated your data and the selection data. no modification to the data made.

Built-in search.

Complete control on the selected items model to fit it to your requirements.

Two view options: normal list and checkboxes.

Pre-selected values.

Limit selection count.

Grouping items by property.

Callback events.

Demo

http://dotansimha.github.io/angularjs-dropdown-multiselect/

Dependencies

required: AngularJS >= 1.2, Lodash >= 2, Bootstrap >= 3.0

Make sure to add the dependencies before the directive’s js file.

Note: Bootstrap JS file is not needed for the directive, it just uses the CSS file.

Install

Download the files

Using bower:

Just run bower install angularjs-dropdown-multiselect

Manually: You can download the .js file directly or clone this repository.

Include the file in your app

<script type=”text/javascript” src=”angularjs-dropdown-multiselect.js”></script>.

You can also use the minfined version (angularjs-dropdown-multiselect.min.js).

Include the module in angular (i.e. in app.js) – angularjs-dropdown-multiselect

Usage and Documentation

See the documentation and examples in the GitHub pages: http://dotansimha.github.io/angularjs-dropdown-multiselect/

由以上英文文档可以得知,若使用angularjs-dropdown-multiselect,首先需要在index.html中引入AngularJS >= 1.2, Lodash >= 2, Bootstrap >= 3.0,如下所示:

<script src=“js/angularjs-dropdown-multiselect.js”></script>

<script src=“js/lodash.min.js”></script>

并在app.js模块中添加依赖angularjs-dropdown-multiselect。如下所示:

var routerApp = angular.module(‘routerApp’, [‘ui.router’‘ngCookies’‘ngTable’‘angularjs-dropdown-multiselect’‘MedListModule’]);

yh_set_dtl.html核心代码如下:

<div style=”float:left>优 惠 类 型:</div>

<!– Demo –>

<div ng-dropdown-multiselect=“” 

 options=“yhctlModelOptions” 

 selected-model=“yhctlModel”

 checkboxes=“true”>

</div>

controllers.js代码如下:

 $scope.yhctlModel = [];

 

 $scope.yhctlModelOptions = [ 

                              {id: 1, label: ‘限定用户’}, 

                              {id: 2, label: “限定商家”}, 

                              {id: 3, label: “限定使用次数”},

                              {id: 4, label: “限定药品”}, 

                              {id: 5, label: “与其它优惠共享”}];

效果图如下:

 AngularJS进阶(五)Angular实现下拉菜单多选

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/164218.html原文链接:https://javaforall.net

(0)
上一篇 2022年7月25日 上午10:00
下一篇 2022年7月25日 上午10:00


相关推荐

  • docker搭建kafka集群

    docker搭建kafka集群docker搭建kafka集群我在M1mbp上使用的以下镜像新建文件zk-kafka-docker-compose.ymlversion:”2″services:zookeeper:user:rootimage:docker.io/zookeeperports:-“12181:2181″environment:-ALLOW_ANONYMOUS_LOGIN=yesvolumes:-zoo

    2022年4月25日
    41
  • 分享一个TCGA数据库

    分享一个TCGA数据库TCGA TheCancerGen 癌症基因组图谱 是美国国家癌症研究所 NationalCanc 和美国人类基因组研究所 NationalHuma 共同监督的一个项目 旨在应用高通量的基因组分析技术 以帮助人们对癌症有个更好的认知 从而提高对于癌症的预防 诊断和治疗能力

    2026年3月16日
    1
  • idea激活码2021年3月最新激活码在线激活

    idea激活码:https://javaforall.net/100143.html,全栈程序员必看教程网idea激活码推荐

    2022年3月14日
    72
  • Java中char,short,int,long占几个字节和多少位[通俗易懂]

    Java中char,short,int,long占几个字节和多少位[通俗易懂]1.字节:byte:用来计量存储容量的一种计量单位;位:bit2.一个字节等于8位1byte=8bitchar占用的是2个字节16位,所以一个char类型的可以存储一个汉字。整型:byte:1个字节8位-128~127short:2个字节16位int:4个字节32位long:8个字节64位浮点型:float:4个字节32位doub……

    2022年8月15日
    5
  • ajax复习

    ajax复习

    2022年3月13日
    49
  • java中怎么输入数组_java中如何从键盘输入数组

    java中怎么输入数组_java中如何从键盘输入数组相关知识说明:java.util.Scanner是Java5的新特征,我们可以通过Scanner类来获取用户的输入。nextLine()函数:1、以Enter为结束符,也就是说nextLine()方法返回的是输入回车之前的所有字符。2、可以获得空白。在线视频教程分享:java在线学习示例如下:publicclassexchangeNum{publicstaticvoidma…

    2022年6月26日
    37

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号