Copied to clipboard

Flag this post as spam?

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

  • Anton Oosthuizen 206 posts 486 karma points
    Sep 30, 2019 @ 19:30
    Anton Oosthuizen

    Umbraco 8 Section with custom plugin

    Good Day,

    I am at wits end with this problem.

    I have created a section with a plugin as follows : enter image description here

    With the following controller :

    .controller("QuotesAndOrdersController", function ($scope ) {
        $scope.test = "test";

    And the following view :

    <umb-panel ng-controller="QuotesAndOrdersController">
    <p> My test :{{test}} </p> 

    And the following tree controller

     [Tree("QuotesAndOrders", "Orders", IsSingleNodeTree = true, TreeTitle = "Quotes and Orders",
        TreeGroup = "quotesAndOrdersGroup", SortOrder = 5)]
    public class QuotesAndOrdersTreeController : TreeController
        protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
           return new TreeNodeCollection();
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
             return new MenuItemCollection();
        protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
            TreeNode root = CreateTreeNode("-1", "-1", queryStrings, "Quotes and Orders", "icon-chart-curve", false);
            root.RoutePath = $"QuotesAndOrders/{TreeAlias}/orders";
            return root;

    My problem is if you look at the controller $scope.test = "test";

    The controller Executes and the html displays but {{test}} remains empty.

    Some extra eyes will be a great help

  • Marc Goodson 2149 posts 14354 karma points MVP 9x c-trib
    Sep 30, 2019 @ 22:21
    Marc Goodson

    Hi Anton

    I think it is possibly an issue with your view try:

    <div ng-controller="QuotesAndOrdersController">
            <p> My test :{{test}} </p>

    but do also make sure you have a package.manifest file in your app_Plugins folder that will tell Umbraco to load the javascript resource that contains your controller... eg

        javascript: [

    but I think you've probably got that otherwise you'd be seeing an error in the console about it not being defined!

    anyway try a div instead of umb-panel directive, I don't think the directive is expecting ng-controller to be defined...



  • Anton Oosthuizen 206 posts 486 karma points
    Oct 01, 2019 @ 02:34
    Anton Oosthuizen

    Mark, you're a genius. You saved my ass. It was indeed the controller in the umb-panel. I wrapped that in a div and all works as it is supposed to.

Please Sign in or register to post replies

Write your reply to: