typescriptsharepointtaxonomysharepointframework

Get Or Reading Data Taxonomy Term Store Sharepoint


I create web part with share point framework "no JavaScript framework" my code with TypeScript I have problem, I will get, or reading data taxonomy term store share point.

And my code in image enter image description here

Question: how to declare variable "SP" in my code? Because my code error asking variable "SP" to declare first


Solution

  • SP is part of sp.js,but as you are working with SPFX WebPart, you should use TypeScript instead, please check the demo to read Taxonomy in SPFX webpart:

    Taxonomy Web Part

    And this file shows get Term from Term Store using TypeScript:

    sp-dev-fx-webparts/samples/knockout-taxonomy/src/webparts/termSetRequester/data-helpers/DataHelperSP.ts