angularjs三級省市聯動
阿新 • • 發佈:2019-02-02
city.json中存放省市聯動資料
結構:
controller中的使用
controller中使用
html關鍵程式碼
實現效果:<div> <label>所在區域:</label> <select name="province" ng-model="address.province" ng-options="p.name as p.name for p in region" ng-change="city='';"></select> <select name="city" ng-model="address.city" ng-options="c.name as c.name for c in region | cityfilter : address" ng-change="area='';"></select> <select name="area" ng-model="address.area" ng-options="a.value as a.value for a in region | areafilter : address" ></select> </div>