如上面areaVal是ng-repeat="district in city.child"生成的,然后在JS中取不到?(其实我也不确定是不是因为 这个原因) $scope.addDistrict = function(pid) { console.log($scope.areaVal); =>udf };
- <input type="text" ng-model="areaVal" name="" id="" class="add"> <input type="button" ng-click="addArea()" value="添加区域">{{areaVal}}