I want to develop a recent document widget using Angular js and REST api. Here is the code that I have:
var spApp= angular.module('spng-App', []);
spApp.controller('spng-WebCtrl', function($scope, $http){
$http({
method: "GET",
url:_spPageContextInfo.webAbsoluteUrl+"/_api/web/Lists/GetByTitle('Docwidget')/items?$select=Title,ID",
headers: {"Accept":"application/json;odata=verbose"}
}).success(function(Folderdata, status, headers, config){
$scope.Folders= Folderdata.d.results;
}).error(function (Folderdata, status, headers, config){
});
});
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<!-- Appel au fichiers JS -->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
<script type="text/javascript" src="/sites/Publishing/_catalogs/masterpage/Devcollabshareapp/app_test_Docs/ControlDocs.js"></script>
<!-- Fin Appel au fichiers JS -->
<style type="text/css">
.files-table th{ background-color:#ddd; border:2px solid #fff; text-align:left}
.files-table td{ background-color:#eee; border:2px solid #fff;}
.web-heading{ padding:2px;}
</style>
</head>
<body>
<div ng-app="spng-App">
<div ng-controller="spng-WebCtrl">
<!-- Populate Files based on selected Folder -->
<table width="100%" cellpadding="10" cellspacing="2" class="files-table">
<tr>
<th>Title</th>
<th>ID</th>
</tr>
<tr ng-repeat="Folder in Folders">
<td><a href="{{Folder.ServerRelativeUrl}}">{{Folder.Title}}</a></td>
<td>{{Folder.Id}}</td>
</tr>
</table>
</div>
</div>
</body>
</html>
I have a library on Sharepoint 2013 called "Docwidget" and I want to recover the files it contains. Until then, I get to retrieve the titles and Id and not the other details, and in addition when I click on the file, it does not open. Is the problem in recovering the URL of the files? If not other proposals?


