Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-city-select

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-city-select

AngularJS 省份城市联动

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

AngularJS 省份城市联动

类似淘宝收货地址的所在地。过于仓促,暂时先这样子吧。

升级日志

v1.0.1

  1. 升级地址库为最新县及县以上行政区划代码(截止2013年8月31日),去掉自治区等字眼。
  2. 修复县区选中值累计问题。
  3. 新增邮政编码。

使用说明

添加angular.city.select模块到你的应用。

angular.module('myApp', ['angular.city.select', ...]);

html标记

<city-select ng-model="item.city"></city-select>

ng-model必须是一个带有*.city对象,另一方面,对于初始化,支持两种方式分别是:

// 按名称顺序,当未找到时中止。
$scope.item = {
    city: [ '安徽', '芜湖', '弋江' ]
};

// 按区域ID
$scope.item.city = '340203';

onCitySelected 事件

app.controller('myController', ['$scope', function($scope){

	$scope.$on('onCitySelected', function(event, item) {
        // item.cn[] 数组,和面板数量相对应。
        // item.id 区域ID
        // item.zip 邮政编码
	}
	
}]);

bower install

$ bower install angular-city-select --save

Keywords

FAQs

Package last updated on 13 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc