Copied to clipboard

Flag this post as spam?

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


  • John Churchley 272 posts 1258 karma points c-trib
    Aug 15, 2016 @ 15:58
    John Churchley
    0

    Custom property editor - Get Node Name

    Hi,

    Anyone know how to get the node name in a custom property editor?

    editorState doesn't appear to contain the value.

  • Cimplex 113 posts 576 karma points
    Aug 15, 2016 @ 16:06
    Cimplex
    0

    Hi John,

    <p>
        Are you sure you want to delete {{currentNode.name}} ?
    </p>
    

    // Herman

  • John Churchley 272 posts 1258 karma points c-trib
    Aug 15, 2016 @ 16:19
    John Churchley
    0

    Hi Herman,

    No that doesn't work i'm afraid.

  • Cimplex 113 posts 576 karma points
    Aug 15, 2016 @ 17:08
    Cimplex
    0

    Hi John, Try this instead:

      angular.module("umbraco").controller("testController", function ($scope, $routeParams, $http, contentResource) {
            contentResource.getById($routeParams.id)
              .then(function (data) {
                    console.log(data.name);
                });
        });
    

    The data variable contains all information about your node.

    // Herman

  • John Churchley 272 posts 1258 karma points c-trib
    Aug 16, 2016 @ 09:39
    John Churchley
    0

    Hi Herman,

    That works accept it doesn't update when the name has been edited by the user.

    I ended up binding to

    editorState.current
    
Please Sign in or register to post replies

Write your reply to:

Draft