Hello, I want to ask how to find an element from the given annotation from DocumentModel on the Front-end side
In the old a12 version, we have a method to find element by annotation like:
static findElementsByAnnotation(documentModel: DocumentModel, annotation: string): Element[] {
const groupIterator = new GroupIterator(documentModel.documentModelRoot);
let elements: Element[] = [];
for (let result = groupIterator.next(); !result.done; result = groupIterator.next()) {
elements.push.apply(elements, result.value.elements.filter((e: Element) => e.annotations[annotation]));
}
return elements;
}
I want to build a similar method in 2023.02 version, but I could not find the replacement of GroupIterator