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


相关推荐

  • scikit-learn代码实现SVM分类与SVR回归以及调参

    scikit-learn代码实现SVM分类与SVR回归以及调参分类二分类:fromsklearn.model_selectionimporttrain_test_splitfromsklearn.svmimportSVCimportmglearn.datasetsimportmatplotlib.pyplotasplt#forge数据集是一个二维二分类数据集X,y=mglearn.tools.make_handcraf…

    2022年10月29日
  • java实现excel导入导出功能_java导出excel合并列

    java实现excel导入导出功能_java导出excel合并列一、在后台实现,利用java的poi1、导入jar包,需要导入lib文件夹下如下包:poi-3.11-20141221.jarpoi-ooxml.jarpoi-ooxml-schemas.jar2、在util下写一个公共类,该类主要利用JakartaPOIHSSFAPI组件(用于操作Excel的组件),主要部分包括Excel对象,样式和格式,还有辅助操作。常用组件:……………

    2022年8月10日
  • Myeclipse SVN插件使用

    Myeclipse SVN插件使用1.安装svn插件网络不好采用link方式安装也方便以后卸载,首先下载site-1.10.9.zip文件从中解压出features与plugins文件夹,复制到E:\MyEclipse\svn(该文件夹位置随意)里面在E:\MyEclipse\MyEclipse10.0\dropins(myeclipse安装位置)下新建文件svn.link,内容是:path=E:\\MyEclipse\\s

    2022年7月20日
  • slam技术前景_哄哄什么

    slam技术前景_哄哄什么原标题:牛逼哄哄的SLAM技术即将颠覆哪些领域?什么是SLAM?机器人在未知环境中,要实现智能化需要完成三个任务,第一个是定位(Localization),第二个是建图(Mapping),第三个则是随后的路径规划(Navigation)。之前地平线的高翔博士用这样一句话概括SLAM的释义。不过实际生活中的SLAM都是和激光雷达或者单目/双目摄像头结合的形式出现在我们面前的,有时甚至跟更多的…

    2022年9月30日
  • 2021ArchLinux安装图文教程「建议收藏」

    2021ArchLinux安装图文教程「建议收藏」主要为以下步骤:1.下载ArchLinux安装镜像并制作U盘启动工具2.开机从U盘启动3.进行联网4.编辑镜像站文件(选择一个比较快的中国镜像源)5.开始分区(UEFI+GPT)6.格式化分区,并挂载7.开始安装基本操作系统8.配置基础系统9.引导系统10.用户管理11.网络配置12.安装桌面环境13.安装完后的工作开始:1.下…

    2022年4月25日
  • git查看分支创建时间_git版本分支图怎么看

    git查看分支创建时间_git版本分支图怎么看git查看分支创建时间gitreflogshow–date=iso<branchname>可以查看到指定分支的历次更改记录,最下面一条的时间即是分支创建时间。

    2022年10月1日

发表回复

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

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