So I have this little small snippet inside my code as shown below:
const menus = wp.api.models.Post.extend({
url: wpApiSettings.root + 'fh/v1/menus/' + path,
});
const Menus = new menus();
console.log(Menus.attributes);
How could I access the properties inside the object? I tried doing Menus.attributes.success
or Menus.attributes.data
but I keep getting a undefined answer – All help is appreciated!
I think that is a class, and you would have to expose those properties with getters: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get