Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/435.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Angular.js ng使用json不重复任何数据_Javascript_Json_Angularjs - Fatal编程技术网

Javascript Angular.js ng使用json不重复任何数据

Javascript Angular.js ng使用json不重复任何数据,javascript,json,angularjs,Javascript,Json,Angularjs,我有一个我正在做的项目,其中有一个json数组(稍后将来自web服务) 我尝试使用ng repeat将数据加载到表中。(我以前做过,这次只是想告诉我我错过了什么) 我将代码发布到github这里: 我希望得到任何帮助,我也在这里发布代码: <body ng-app="MyApp"> <div ng-controller="SchCtrl"> <table class="table table-striped table-bordered">

我有一个我正在做的项目,其中有一个json数组(稍后将来自web服务)

我尝试使用ng repeat将数据加载到表中。(我以前做过,这次只是想告诉我我错过了什么)

我将代码发布到github这里:

我希望得到任何帮助,我也在这里发布代码:

<body ng-app="MyApp">
<div ng-controller="SchCtrl">

    <table class="table table-striped table-bordered">
        <thead>
        <th width="15%">Date and Time</th>
        <th width="50%">Provider</th>
        <th width="15%">Location</th>
        <th width="10%">Map</th>
        </thead>
        <tbody>
        <tr ng-repeat="appointment in appointments | orderBy:'startDatetime':true">
            {{appointments.startDatetime | date:'MM/dd/yyyy HH:mm'}}
            {{appointments.providerName}}
{{appointments.apptLocation}}</tr></tbody></table>


</div>
</body>

尝试访问
appointment.startDatetime
而不是
appointment.startDatetime
providerName
apptLocation
也一样。基本上删除约会中的
s

不应该吗

$scope.appointments = data.appointments
?? 然后你必须访问

appointment.<field_name>
预约。
您可以查看
1.您需要将所有数据包装在TD标签中
2.要访问您的数据,您需要像访问data.Appoints一样访问数据
3.在
ng repeat
中,您需要访问约会数组中的每个项目-这就是
约会

。。。您没有为调试而删除的
appointment.<field_name>