I have developed a unique Umbraco 7 dashboard where I aim to retrieve specific field details from instances of a particular document type in my Umbraco CMS.
After successfully obtaining a list of all documents of the specified type using
entityResource.getChildren(1386, "Document")
, I then proceed to call entityResource.getById(item.id, "Document")
for each document. While I can view many details for each document instance, I am unable to access the data entered by the editor during creation. How can I retrieve this information utilizing Umbraco's Angular services/API?
Here is a snippet of the code within the dashboard:
// fetching community alerts
entityResource.getChildren(1386, "Document")
.then(function (ent)
{
angular.forEach(ent, function (item)
{
let communityalert = {
umbracoItem: item,
title: '', // Data from each document will be placed here
topic: ''
};
entityResource
.getById(item.id, "Document")
.then(function (entity)
{
console.log('entity', entity);
communityalert.title = entity.name;
communityalert.umbracoItem = entity;
entityResource
.getUrl(item.id, "Document")
.then(function (url)
{
communityalert.url = url;
// Finally, add collected data to VM.
vm.CommunityAlerts.push(communityalert);
});
});
});
});