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


相关推荐

  • 利用matlab画图(r语言能画出哪些图)

    clearallcloseallloadyi.txta=yi;b={‘北京”天津”石家庄”唐山”秦皇岛”太原”呼和浩特”包头’…’沈阳”大连”丹东”锦州”长春”吉林’…

    2022年4月17日
    42
  • bitblt函数_统计参数的含义

    bitblt函数_统计参数的含义【转载请注明出处: http://blog.csdn.net/lzl124631x】接口BOOLBitBlt( _In_ HDChdcDest, _In_ intnXDest, _In_ intnYDest, _In_ intnWidth, _In_ intnHeight, _In_ HDChdcSrc, _I

    2022年10月19日
    5
  • 【C++】0314算法阿里笔试题「建议收藏」

    【C++】0314算法阿里笔试题「建议收藏」一、题目二、自己的dfs的题解#include<bits/stdc++.h>usingnamespacestd;intres3=INT_MAX;inttransfet(vector<string>&tmp){intsum=0;for(auto&t:tmp){sum+=stoi(t);}returnsum;}voiddfs(stringstr,vector&l

    2025年10月9日
    6
  • 我把ConcurrentHashMap & HashTable的知识点都整理了一下[通俗易懂]

    我把ConcurrentHashMap & HashTable的知识点都整理了一下[通俗易懂]都知道HashMap的知识点,你们知道ConcurrentHashMap&HashTable面试怎么问么?

    2022年6月24日
    27
  • 【收藏向】模拟电子技术超强知识点总结 20小时不挂科「建议收藏」

    【收藏向】模拟电子技术超强知识点总结 20小时不挂科「建议收藏」模电真的有难度的一门课,一定要好好学…用的教材是华科康华光版,其他版本教材也可参考,内容是差不多的。话不多说直接上思维导图干货(后有思维导图高清原图链接)1绪论2运算放大器3二极管及其基本电路4场效应管及其放大电路5双极结型三极管及其放大电路三种组态总结看不清,给个特写发现虽然csdn上传的是原图,但是显示的图片不是特别清晰,在此贴出B站知乎地址,第五章之后的内容都在上面,还可以查看原图————————————————————B站专栏地址(可以点击查看原图)htt

    2022年6月20日
    39
  • 安全工具-Sparta

    安全工具-SpartaSparta是一个集端口扫描、网络扫描、服务探测以及暴力激活成功教程等多项功能于一身的工具,kali中已经预装了该工具,可直接使用。  &gt;输入目标IP,开始扫描即可探测出开放的端口及服务  &gt;选中ssh服务,对其进行暴力激活成功教程  &gt;确认IP地址、端口、扫描服务等,上传用户名-密码字典后Run  &gt;查看扫描log,探测出一个密码被激活成功教程Hydrav8.2(c…

    2025年6月9日
    3

发表回复

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

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