I am using angularJS for my application it have bit completion in foreach loop. I created a JSON for following array.
Array
(
[0] => Array
(
[0] => Array
(
[id] => 2
[semester_id] => 1
[dealer_id] => 120
)
[0] => Array
(
[id] => 2
[semester_id] => 1
[dealer_id] => 120
)
)
[1] => Array
(
[0] => Array
(
[id] => 1
[semester_id] => 2
[dealer_id] => 255
)
)
I want to generate this array json as like
<div id="1">
<div>
<span>id = 2,semeter id = 1, dealerid =120</span>
<span>id = 2,semeter id = 1, dealerid =120</span>
</div>
</div>
<div id="2">
<div>
<span>id = 2,semeter id = 1, dealerid =255</span>
</div>
</div>
Can anyone please help on this
I tried this Actually i am using Codeigniter framework with this
app.js
app.controller('dashboard', function($scope, $http) {
dashboard_home(); // Load all available tasks
function dashboard_home(){
$http.post(base_url+"admin/dashboard").success(function(data){
$scope.dashboard = data[0];
});
};
});
I am returning json data from codeigniter controller to view. I used ng-repeat but i am result like
<div>
<span>id = 2,semeter id = 1, dealerid =120</span>
<span>id = 2,semeter id = 1, dealerid =120</span>
</div>
two times i am getting this only. I am not getting this div
<div>
<span>id = 2,semeter id = 1, dealerid =255</span>
</div>