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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Bone Collector——HDOJ杭电2602(纯01背包问题!!!!!!具体解释!)

    Bone Collector——HDOJ杭电2602(纯01背包问题!!!!!!具体解释!)

    2022年2月3日
    48
  • 高通linux-串口笔记「建议收藏」

    高通linux-串口笔记「建议收藏」概述驱动:drivers/tty/serial/msm_serial_hs_lite.c:低速版本,设备树内容配置为compatible="qcom,msm-lsuart-v14";msm_serial_hs.c:高速版本, 设备树内容配置为compatible="qcom,msm-hsuart-v14"; 2.分析设备树内容 uart_cons…

    2022年9月2日
    2
  • ajaxpro 原理[通俗易懂]

    ajaxpro 原理[通俗易懂]应当承认我这人实在算不上弄潮儿,Ajax早已流行得一塌糊涂,我却始终没有来研究一下这个东东。上次做网站的时候,BOSS就跟我讲过,可以参考一下Ajax的技术,我嘴上答应,心里却不是十分的在乎。究其原因,一来是我这人比较固步自封,二来起初确实也没太相信Ajax真有BO

    2022年7月12日
    41
  • js 数组splice_splice会影响原数组吗

    js 数组splice_splice会影响原数组吗今天用到了数组的删除,分别使用了splice和delete方法,记录一下,方便下次查找。原数组是一个关联数组,如vartest=[];test[1]={name:’1′,age:1};test[2]={name:’2′,age:2};test[4]={name:’3′,age:3};console.log(test)长度为5的关联数组,现在开始删除。1.splice方法test.splice(2

    2022年10月1日
    0
  • js将json字符串转换成json对象_java中将字符串转换为json

    js将json字符串转换成json对象_java中将字符串转换为jsonpackagecom.cjonline.foundation.util;importjava.lang.reflect.Field;importjava.math.BigDecimal;importjava.text.SimpleDateFormat;importjava.util.Collection;importjava.util.Date;publicclassJsonUti…

    2022年9月21日
    1
  • sql定义变量的语法是什么_sql 定义变量

    sql定义变量的语法是什么_sql 定义变量有的时候在查询更新数据库的时候,需要多条语句的查询,因此需要多次修改declare可以满足多次执行,但数据只修改一次。declare @local_variabledata_typeDECLARE:定义变量,变量第一个字母是“@”声明时需要指定变量的类型,可以使用set和select对变量进行赋值,在sql语句中就可以使用@local

    2022年8月20日
    10

发表回复

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

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