I have created a custom Umbraco 7 dashboard.(我创建了一个自定义的Umbraco 7仪表板。)
In it I want to get specific field details from instances of a known type of document type in my Umbraco CMS.(在其中,我想从Umbraco CMS中已知类型的文档类型的实例中获取特定字段的详细信息。)
I have successfully obtained a list of all documents of a specific type by using entityResource.getChildren(1386, "Document")
, and subsequently call entityResource.getById(item.id, "Document")
on each such document.(我已经通过使用entityResource.getChildren(1386, "Document")
成功获取了特定类型的所有文档的列表,然后在每个此类文档上调用了entityResource.getById(item.id, "Document")
。)
I can see many details for each document instance, but not the data the editor entered when creating it.(我可以看到每个文档实例的许多详细信息,但看不到编辑器在创建它时输入的数据。) How do I get this information using the Angular services/API of Umbraco?(如何使用Umbraco的Angular服务/ API获取此信息?)
Sample of dashboard code:(仪表板代码示例:)
// get community alerts
entityResource.getChildren(1386, "Document")
.then(function (ent)
{
angular.forEach(ent, function (item)
{
let communityalert = {
umbracoItem: item,
title: '', // I want data from each document to put 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 push collected data to VM.
vm.CommunityAlerts.push(communityalert);
});
});
});
});
ask by Pete Stens?nes translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…