Replies: 1 comment
-
Hi @maalej as described here, everything inside the component What you probably need is to define that logic inside the init method model: {
defaults: {...},
init() {
fetch(`http://localhost:4001/traits`)
.then((response) => response.json())
.then((data) => this.addTrait(data[0]))
}
}, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I need to set traits asynchronously. On component initialization, I fetch traits from a server, however I don't find a way to add them to the component with addTrait.
Here is an example:
it says editor is not defined. Also I am unable to access directly the component traits with this.addTraits(data[0}).
Any help please?
Beta Was this translation helpful? Give feedback.
All reactions