Search code examples
microsoft-graph-toolkit

How do I bind JSON to the controls?


I am calling a graph API myself, is it possible to bind the resulting JSON to 1 of the controls? Say People? I couldn't really find how to do that in the docs.


Solution

  • Some components do have the ability to set the properties manually. For example, the mgt-person component accepts a json object to the person-details attribute (or personDetails property):

    personControl.personDetails = {
        displayName: 'Nikola Metulev',
        email: '[email protected]',
        image: 'url'
    }
    

    The people has the people property which works the same way (it's an array of persons)