Inside a SPFx web part, I have been trying really hard to list out the labels (red, blue, green) within the Favourite term set. I have not yet been able to achieve this.
Does anybody know how to do this? My brain is melting :(
code:
public async componentDidMount() {
const store: ITermStore = taxonomy.termStores.getByName("Taxonomy_O1cHqzMmDZNz4UeaKJLVpA==");
// get a single term by id
const term: ITerm = store.getTermById("6a488843-cebc-47b7-8606-e4e165e6fceb");
const labels: ILabels = term.labels;
const labelsWithData = term.labels.get();
{ setTimeout(() => {
console.log('1', store);
console.log('2',labels);
console.log('3',labelsWithData);
}, 2000); }
}