Copied to clipboard

Flag this post as spam?

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


  • Andreas Norberg 3 posts 73 karma points
    Aug 20, 2019 @ 12:35
    Andreas Norberg
    0

    Argument 'Example.CharLimitController' is not a function, got undefined

    I'm following the tutorial in umbraco tv on extending umbraco and when I try to add a controller for my property editor I get this error message in the console. "Argument 'Example.CharLimitController' is not a function, got undefined" I've tripple checked my code and it's exactly the same as in the video. I'm using Umbraco 7.2.4 as it was the version used in the video.

    package.manifest

    {
      propertyEditors: [
        {
          alias: "CharLimit",
          name: "Char Limit",
          editor: {
            view: "~/App_Plugins/Example/charlimit.editor.html"
          }
        }
      ],
    
      javscript: [
        "~/App_Plugins/Example/charlimit.controller.js"
      ]
    }
    

    charlimit.controller.js

    angular.module("umbraco").controller("Example.CharLimitController", function () {
    
        alert("Hello World!");
    
    });
    

    charlimit.editor.html

    <div ng-controller="Example.CharLimitController">
        <textarea cols="10" ng-model="model.value"></textarea>
    </div>
    
  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Aug 20, 2019 @ 15:53
    Shaishav Karnani from digitallymedia.com
    0

    Please can you update the ClientDependency.config in config folder. You need to update the version number and your changes will start appearing on the umbraco back-end. This is how you clear cached files in the back-office.

    <clientDependency version="1127561132" fileDependencyExtensions=".js,.css" loggerType="Umbraco.Web.UI.CdfLogger, umbraco">
    
  • Andreas Norberg 3 posts 73 karma points
    Aug 21, 2019 @ 08:24
    Andreas Norberg
    0

    I started over and now it works but thanks for the answer. I will keep that in mind if this issue comes up again.

Please Sign in or register to post replies

Write your reply to:

Draft