1.html

<select name="parentColumnId" >
  <option ng-repeat="item in allFL" value="{{item.id}}" ng-selected="item.id==mySelect">{{item.columnName}}</option>
</select>

  select 上设置ng-selected(被选中的值)

  option选项中进行判断 当前的id跟被选中的id是否一致

2.js ===获取所有的分类

$http.get('http://192.168.1.107:8080/healthy/findAllFirstColumn.do')
.success(function(res){
	console.log(res);
	$scope.allFL = res;
}).error(function (err){
	console.log(err);
})

3.===获取当前id的父分类

$http.get('http://192.168.1.107:8080/healthy/findColumnById.do?id='+$routeParams.id)
.success(function(res){
	console.log(res);
	$scope.info = res;
	$scope.mySelect = res.parentColumnId;
}).error(function (err){
	console.log(err);
})

 

相关文章:

  • 2022-12-23
  • 2021-03-29
  • 2022-12-23
  • 2023-01-16
  • 2021-12-06
  • 2022-12-23
  • 2021-11-22
  • 2021-11-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
相关资源
相似解决方案