Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.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
SharePoint 2013 api角度表(在编辑模式下工作)_Sharepoint - Fatal编程技术网

SharePoint 2013 api角度表(在编辑模式下工作)

SharePoint 2013 api角度表(在编辑模式下工作),sharepoint,Sharepoint,我试着从角度看一张桌子 我在Web部件内容编辑中使用sharepoint api和角度获取请求 我仅在编辑Web部件时才能看到表格数据 屏幕快照规则模式 屏幕快照编辑模式 怎么了?下面的代码供您参考 <h1>WelCome To Angular JS Sharepoint 2013 REST API !!</h1> <div id="mytest" ng-app="SharePointAngApp" class="row"> <div ng-c

我试着从角度看一张桌子 我在Web部件内容编辑中使用sharepoint api和角度获取请求 我仅在编辑Web部件时才能看到表格数据 屏幕快照规则模式

屏幕快照编辑模式


怎么了?

下面的代码供您参考

<h1>WelCome To Angular JS Sharepoint 2013 REST API !!</h1>
<div id="mytest" ng-app="SharePointAngApp" class="row">
    <div ng-controller="spCustomerController" class="span10">
        <table class="table table-condensed table-hover">
            <tr>
                <th>ID</th>
                <th>Title</th>
            </tr>
            <tr ng-repeat="customer in customers">
                <td>{{customer.ID}}</td>
                <td>{{customer.Title}}</td>
            </tr>
        </table>
    </div>
</div>

<style>
#mytest table,#mytest td, #mytest th {
    border: 1px solid green;
}
#mytest th {
    background-color: green;
    color: white;
}
</style>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<script type="text/javascript">
var myAngApp = angular.module('SharePointAngApp', []);
myAngApp.controller('spCustomerController', function ($scope, $http) {
    $http({
        method: 'GET',
        url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('ListA')/items?$select=ID,Title",
        headers: { "Accept": "application/json;odata=verbose" }
    }).success(function (data, status, headers, config) {
        $scope.customers = data.d.results;
    }).error(function (data, status, headers, config) {
    });
});
</script>