Copied to clipboard

Flag this post as spam?

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


  • Jeremy Pyne 106 posts 246 karma points MVP c-trib
    Sep 08, 2014 @ 19:41
    Jeremy Pyne
    1

    How and i read properties in angularJs

    I'm customising some views and I want to be able to read proeprties for the currently selected node to so to work.  I found the controller for my view(ListView in my case and can see the Id and do work on it.  I can't seam to figure out how to read proeprties for the current document though.  I have the Id from $routeParams.id.  Code:

     

    contentResource.getById($routeParams.id).then(function (content) {

                if(content.umbracoListViewPageSize)

     

                    $scope.options.pageSize = content.umbracoListViewPageSize;

    });

     

    where contentResource.getById is the contentResource(or mediaResource) and umbracoListViewPageSize is a custom property i createdd on the document.  I can see the base propertie sof the document and can see the properties organisied by tabs.  (I don't wnt to access teh property by tab becosue the screen layout could change.)

     

  • Sören Deger 733 posts 2844 karma points c-trib
    Feb 23, 2015 @ 12:16
    Sören Deger
    0

    Hi Jeremy,

    you can get all properties with contentEditingHelper:

    contentResource.getById($routeParams.id)
            .then(function (content) {
                var props = contentEditingHelper.getAllProps(content);
    }); 

     

    Cheers,

    Sören

  • HuaweiP9User 31 posts 122 karma points notactivated
    Aug 10, 2018 @ 14:24
    HuaweiP9User
    2

    I tried that but this seems that doesnt work. Can you show me full code? With this code we need to get all properties from current doc type (or node)

  • kalgi kansara 18 posts 108 karma points
    Jul 13, 2021 @ 13:54
    kalgi kansara
    0

    Do you have any idea about it now..??

Please Sign in or register to post replies

Write your reply to:

Draft