Question

I'm trying to get a basic custom property editor sorted out for an Umbraco 7.0.1 solution but it looks like I've missed something somewhere because Angular can't recognise the controller function being called. I need another pair of eyes over this.

I've pretty much copied and pasted the example provided on Umbraco's site to start with and was intending to flesh it out afterwards. Here's what I have so far:

package.manifest

{   
    //you can define multiple editors   
    propertyEditors: [      
        {
            /*this must be a unique alias*/ 
            alias: "AcuIT.Multidate",
            /*the name*/
            name: "Multidate Picker",
            /*the html file we will load for the editor*/
            editor: {
                view: "~/App_Plugins/Multidate/multidate.html"
            }
        }
    ]
    ,
    //array of files we want to inject into the application on app_start
    javascript: [
        '~/App_Plugins/Multidate/multidate.controller.js'
    ]
}

multidate.html

<div ng-controller="AcuIT.MultidateController">
    <textarea ng-model="model.value"></textarea>
</div>

multidate.controller.js

angular.module("umbraco")
    .controller("AcuIT.MultidateController",
    function () {
        alert("The controller has landed");
    });

Finally, here is the error I'm seeing in the browser console:

Error: Argument 'AcuIT.MultidateController' is not a function, got undefined at Error ()

It's probably a name or a path I've missed somewhere but I can't spot it yet. Any pointers appreciated.

Was it helpful?

Solution

Restart app pool and refresh browser to include the files from the manifest

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top