I have implemented ng-repeat to create a table including the paging and all, data source for that table is coming from SharePoint REST API.
I am facing a challenge because on of the fields that I need to show in the ng-repeat data source have a link, but I need to extract the data from that URL. I don't know if I am able to convey the problem statement or not. Let me try with an example
Let's say we have a data source, array of object SearchResult it has few properties, like:
SearchResult.ID
SearchResult.ReferenceNumber
SearchResult.CreatedBy
SearchResult.Files //This Files attribute in the object is a link to a page which contains JSON/XML information about the files. I need to extract that information and show the extracted files links instead of a link to this page.
Please let me know is there any way I can send an async call to get json/xml for this particular field within ng-repeat.
$scope.GetFileNames =function(query)
{
var returndata;
$http({
method: 'GET', url: query,
headers: { "Accept": "application/json;odata=verbose" }
}).
success(function (data, status, headers, config) {
debugger;
returndata= data;
}).
error(function (data, status, headers, config) {
debugger;
// called asynchronously if an error occurs
// or server returns response with an error status.
returndata= data
});
return returndata;
}
<td>
<span>{{GetFileNames(history.Files)}}</span>
</td>