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


相关推荐

  • cover letter and response letter

    cover letter and response letter在此之前先区分投稿CoverLetter,修改稿CoverLetter和ResponseLetter,前两个是写给编辑或者TopicEditor,后者是写给Reviwer。一般来说在提交稿件时我们会附带一封CoverLetter主要是一些客套话跟编辑说的。修改稿CoverLetterDearProfessor***:(***指的是负责你论文的编辑,不知道名字就写Editor)    Onbehalfofmyco-authors,we

    2022年6月2日
    30
  • VMware虚拟机安装Ubuntu20.04详细图文教程[通俗易懂]

    VMware虚拟机安装Ubuntu20.04详细图文教程[通俗易懂]Windows下VM16虚拟机安装Ubuntu20.04下载链接和手把手的详细教程,同时还有更换软件源和命令行安装VMTools实现跨系统复制粘贴教程

    2022年10月1日
    2
  • 前端样式库_freelist数据结构

    前端样式库_freelist数据结构这个过程主要分为三个步骤:数据预处理数据处理就是把数据按照一定的格式写出来,以便网路自己去读取数据1准备原始数据我的cloth数据一共是四个类别,每个类别有衣服47张,一用是188张图片,这些

    2022年8月2日
    6
  • Conscript_const let var

    Conscript_const let var1.let命令基本语法ES6新增了let命令,用来声明变量。它的用法类似于var,但是所声明的变量,只在let命令所在的代码块内有效。{leta=1varb=2console

    2022年7月29日
    6
  • 社区版pycharm flask封装接口[通俗易懂]

    社区版pycharm flask封装接口[通俗易懂]因为装的pycharm版本是社区版,没有单独的flask项目创建入口1、首先和创建python项目一样创建一个项目:要选择虚拟环境(一般默认即可)2、项目文件夹下安装flask:npminstallflask前端渲染后续研究,此次只封装接口3导包notes:1、调试过程中要手动打开debug模式2、cors是解决前端跨域问题impor…

    2025年7月25日
    3
  • 快播创始人王欣成立人工智能公司[通俗易懂]

    快播创始人王欣成立人工智能公司[通俗易懂]快播创始人王欣成立人工智能公司

    2022年4月20日
    63

发表回复

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

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