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


相关推荐

  • RESETful API 设计规范

    RESETful API 设计规范

    2021年6月18日
    85
  • Vue(1)Vue安装与使用[通俗易懂]

    Vue(1)Vue安装与使用[通俗易懂]前言Vue(读音/vjuː/,类似于view)是一套用于构建前后端分离的框架。刚开始是由国内优秀选手尤雨溪开发出来的,目前是全球“最”流行的前端框架。使用vue开发网页很简单,并且技术生态环境完善

    2022年7月30日
    4
  • jquery $.post

    jquery $.post

    2022年1月25日
    41
  • Java数据库JDBC——prepareStatement的用法和解释

    Java数据库JDBC——prepareStatement的用法和解释转自:http://blog.csdn.net/QH_JAVA/article/details/48245945一、prepareStatement的用法和解释1.PreparedStatement是预编译的,对于批量处理可以大大提高效率.也叫JDBC存储过程2.使用Statement对象。在对数据库只执行一次性存取的时侯,用Statement对象进行处理。Prepared…

    2022年4月28日
    59
  • PotPlayer下载与使用

    PotPlayer下载与使用下载安装说起来,Potplayer的下载其实并不轻松,它在国内是没有自己的官网;虽然你简单百度下,总能找到下载网站,但是并不能保证其安全和纯净,个人建议从这个官网下载:下载入口:Potplayer官网/公众号分享Potplayer的官网提供有64位和32位两种版本,我们只需要选择好适合自己系统类型的版本,点击下载;一般系统都是64位,如果还不知道的自己电脑系统类型,那么右键桌面“我的电脑”图标,选择“属性”,进入之后,即可查看;下载完成后,得到一个exe文件,双击打开;依次点击“下一步

    2022年7月12日
    34
  • ubuntu18.04安装ros melodic_ubuntu opengl

    ubuntu18.04安装ros melodic_ubuntu opengl软硬件(1)软件:装有ROS_melodic的Ubuntu18.04系统(2)硬件:台式机和kinectV1摄像头下载安装以及遇到的问题主要参考:https://blog.csdn.net/qq_29828623/article/details/60765043#PrepareWorkspacesource/opt/ros/melodic/setup.bashmkdir-p~…

    2022年9月17日
    4

发表回复

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

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