我的ng-repeat在ul内部没有工作。请帮助我。
使用此代码
<div ng-controller="user">
<div ng-init="tender_in_state()" >
<ul ng-repeat="t in stateTender" >
<li><a href="<?php echo base_url(); ?>tenderByState/{{t.id}}" >a</a></li>
</ul>
</div>
</div>
angular js用户控制器
$scope.stateTender = {};
$scope.tender_in_state = function() {
Data.TenderInState().success(function(data) {
$scope.stateTender = data;
//alert();
});
}
服务请求功能
this.TenderInState = function ($data) {
return $http.post(site_url + "User_controller/getTenderInStateList",$data);
};
在用户控制器中
public function getTenderInStateList() {
$data[] = $this->service->getTenderInStateList($data);
echo json_encode($rs);
}
在服务模式中
public function getTenderInStateList($id){
$rs = $this->db->select('*')
->from('et_state')
->where('id',$id)
->get()->row();
return $rs;
}
任何人都可以帮助我解决问题
答案 0 :(得分:0)
ng-repeat继续使用将要重复的元素。在你的情况下&#34; li&#34;元件。 你得到了什么错误?不打印或重复&#34; ul&#34;元素甚至其他东西?
PS:对不起,我的英文不好