where the model is the details of the property you want to display: for example for a toggle this might look like :
vm.model = {
Alias = "autoSend",
Label = "On or Off",
Description = "Turn this thing on or off",
Value = vm.myValue,
View = "boolean",
Config =
{
{ "default", null }
},
};
The trick here is knowing what goes in the Config element as this can be different depending on the property type - there is not really a quick way to get this information at the moment, other than look at how it might be returned by Umbraco for a content item :
e.g if you look in chrome for network requests to GetById?id= you should be able to drill down, (under the variants tab) to something like this:
which will show you what Umbraco is passing into the Model value when it uses umb-property-editor.
in practice sometimes if you know what the type is you want it's often easier to call the directive for that. e.g for a checkbox this looks like :
<umb-control-group label="On or Off" description="Turn this thing on or off">
<umb-toggle checked="vm.myValue"
on-click="vm.myValue = !vm.myValue"
label-on="on"
label-off="off"></umb-toggle>
Umbraco Backoffice Angular Components
How can I use the umbraco umbproperty component in a custom backoffice dashboard?
I was looking on the documentation, but there isn't a helpfull example :(
Hi Enrique
it depends a bit on what property you wish to display through the property editor.
slightly better documentation would show this as
where the model is the details of the property you want to display: for example for a toggle this might look like :
The trick here is knowing what goes in the Config element as this can be different depending on the property type - there is not really a quick way to get this information at the moment, other than look at how it might be returned by Umbraco for a content item :
e.g if you look in chrome for network requests to GetById?id= you should be able to drill down, (under the variants tab) to something like this:
which will show you what Umbraco is passing into the Model value when it uses umb-property-editor.
in practice sometimes if you know what the type is you want it's often easier to call the directive for that. e.g for a checkbox this looks like :
Thanks for your help.
I think umbraco would be great if they make a good documentation...😒
is working on a reply...