Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Enrique Capellan 40 posts 173 karma points
    Nov 21, 2019 @ 16:39
    Enrique Capellan
    0

    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 :(

    enter image description here

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Nov 21, 2019 @ 21:59
    Kevin Jump
    101

    Hi Enrique

    it depends a bit on what property you wish to display through the property editor.

    slightly better documentation would show this as

    <umb-property-editor model="vm.model"></umb-property-editor>
    

    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:

    enter image description here

    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>
    

  • Enrique Capellan 40 posts 173 karma points
    Nov 25, 2019 @ 15:23
    Enrique Capellan
    0

    Thanks for your help.

    I think umbraco would be great if they make a good documentation...😒

Please Sign in or register to post replies

Write your reply to:

Draft