However, when I run Umbraco and navigate to my custom editor page I'm getting an error with the AngularJS Controller "Error: Argument 'DataExport.DataExportTree.EditController' is not a function, got undefined". If I take the ng-controller="DataExport.DataExportTree.EditController" tag out of my markup then the page renders with no errors (but obviously no AngularJS kicking in), so my tree configuration and paths all seem to be correct.
The tutorial doesn't mention anything about how the javascript file is picked up by Umbraco - do I need to reference this in a .manifest file or somewhere else?
Any clues would be greatly appreciated as I've been through this tutorial a few times now and I'm not getting anywhere... :s
Not quite sure where things go wrong in the above code but just want to mention that you should try and check out the Umbraco Angular workbook at https://github.com/umbraco/AngularWorkbook there is some sample code in chapter 5 I think, which you may be able to benefit from.
Also yes your javascript needs to be referenced in the manifest as is shown in the examples in this book as well.
Thanks Dave - the code in your first link helped me get it working! I think the issue was the manifest file was not in the root of my plugin, so my controller wasn't being registered...
Problem creating custom Editor
Hi,
I'm following this how-to on creating a custom editor, and as far as I Can tell I'm doing everything correct, but I just can't get it to work: http://umbraco.github.io/Belle/#/tutorials/Creating-Editors-Trees
My code class looks like this:
My AngularJS controller code looks like this:
'use strict'; (function() { //create the controller function dataExportController($scope, $routeParams) { $scope.content = { tabs: [{ id: 1, label: "Export Organisation Data" }, { id: 2, label: "Export Member Data" }] }; }; //register the controller angular.module("umbraco").controller('DataExport.DataExportTree.EditController', dataExportController); })();
and my edit.html view looks like this:
My App_Plugins folder structure looks like this:
However, when I run Umbraco and navigate to my custom editor page I'm getting an error with the AngularJS Controller "Error: Argument 'DataExport.DataExportTree.EditController' is not a function, got undefined". If I take the ng-controller="DataExport.DataExportTree.EditController" tag out of my markup then the page renders with no errors (but obviously no AngularJS kicking in), so my tree configuration and paths all seem to be correct.
The tutorial doesn't mention anything about how the javascript file is picked up by Umbraco - do I need to reference this in a .manifest file or somewhere else?
Any clues would be greatly appreciated as I've been through this tutorial a few times now and I'm not getting anywhere... :s
Hi Maff
Not quite sure where things go wrong in the above code but just want to mention that you should try and check out the Umbraco Angular workbook at https://github.com/umbraco/AngularWorkbook there is some sample code in chapter 5 I think, which you may be able to benefit from.
Also yes your javascript needs to be referenced in the manifest as is shown in the examples in this book as well.
Hope this helps a bit.
/Jan
Thanks Jan - I'll check that out!
Maff
As Jan already stated you have to add the js file to your package manifest
For some example code on creating custom sections have a look at the source code of my DUUG and UmbUkFest talks
https://bitbucket.org/dawoe/duugcustomsections
https://bitbucket.org/dawoe/umbukfestival2014
And of course my slides of the DUUG talk which contains some useful links at the end :
http://www.slideshare.net/dawoe/duug-meetup-custom-sections-v6-vs-v7
Dave
Thanks Dave - the code in your first link helped me get it working! I think the issue was the manifest file was not in the root of my plugin, so my controller wasn't being registered...
Thanks again :)
Maff
is working on a reply...