npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-city-select

v1.0.0

Published

AngularJS 省份城市联动

Downloads

6

Readme

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