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 244 karma points MVP c-trib
    Sep 08, 2014 @ 19:41
    Jeremy Pyne
    0

    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 698 posts 2670 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 120 karma points notactivated
    Aug 10, 2018 @ 14:24
    HuaweiP9User
    0

    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)

Please Sign in or register to post replies

Write your reply to:

Draft