I recently started learning AngularJS. When I getting data from the database an array, I using function foreach, so my code is
<ul>
<?php foreach($Items as $Item):?>
<li><?php echo $Item['name'];?></li>
<?php endforeach;?>
</ul>
I use AngularJS because I need sortable list elements. And my code with AngularJS roughly the
<script>
function PositionsList($scope){
$scope.positions=<?php echo json_encode($Items);?>
}
</script>
<ul>
<li ng-repeat="position in positions | filter:query">
<p>{{position.name}}</p>
</li>
</ul>
Is it possible to do so? If not, how to get the data received from server, If not use $http.post/get?