我从数据库中获取数据并显示它:
<ul>
<li ng-repeat="item in items>
<mydate>{{item.date}}</mydate>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
{{item.date}}Unix日期在哪里,如1374843600.如何使用AngularJS指令设置日期格式?可能吗?
当我尝试这样做时,我得到了标签mydate的值 - {{item.date}}
我最近开始学习AngularJS.当我从数据库中获取数据时,我使用函数foreach,所以我的代码是
<ul>
<?php foreach($Items as $Item):?>
<li><?php echo $Item['name'];?></li>
<?php endforeach;?>
</ul>
Run Code Online (Sandbox Code Playgroud)
我使用AngularJS因为我需要可排序的列表元素.而我的代码与AngularJS大致相同
<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>
Run Code Online (Sandbox Code Playgroud)
有可能这样做吗?如果没有,如何从服务器获取数据,如果不使用$ http.post/get?