U4-4289 - controller in custom section won't load

Created by Marcel Lüscher 24 Feb 2014, 14:10:23 Updated by Marcel Lüscher 24 Feb 2014, 15:31:11

I started to create a custom section with his own tree and controllers:

I used this documentation: http://umbraco.github.io/Belle/#/tutorials/Creating-Editors-Trees

As the documentation said, I created a controller:

the file naming conventions are based on the controller file naming conventions in the Umbraco core.

So I ended in this structure: App_Plugins/MessageSection/backoffice/MessageSectionTree/create.html App_Plugins/MessageSection/backoffice/MessageSectionTree/edit.html App_Plugins/MessageSection/backoffice/MessageSectionTree/MessageSection.MessageSectionTree.Create.Controller.js App_Plugins/MessageSection/backoffice/MessageSectionTree/MessageSection.MessageSectionTree.Edit.Controller.js

Both controller contains: angular.module("umbraco").controller("MessageSection.MessageSectionTree.EditController", function ($scope, $http) { alert("I am an alert box!"); });

In my console I can figure out, the html will load - but the controller itself: Error: Argument 'MessageSection.MessageSectionTree.EditController' is not a function, got undefined at Error () at cb (http://localhost:65204/umbraco/lib/angular/1.1.5/angular.min.js:17:79) at xa (http://localhost:65204/umbraco/lib/angular/1.1.5/angular.min.js:17:187) at http://localhost:65204/umbraco/lib/angular/1.1.5/angular.min.js:53:310 at http://localhost:65204/umbraco/lib/angular/1.1.5/angular.min.js:44:274 at n (http://localhost:65204/umbraco/lib/angular/1.1.5/angular.min.js:7:74) at k (http://localhost:65204/umbraco/lib/angular/1.1.5/angular.min.js:44:139) at e (http://localhost:65204/umbraco/lib/angular/1.1.5/angular.min.js:40:139) at http://localhost:65204/umbraco/lib/angular/1.1.5/angular.min.js:39:205 at http://localhost:65204/umbraco/lib/angular/1.1.5/angular.min.js:158:18 angular.min.js:63

I also tried to load the script ''by hand'' - which wouldn't be a solution:

I tried to solve this problem with a forum request: http://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/48549-Create-An-Angular-controller-in-custom-section

Comments

Marcel Lüscher 24 Feb 2014, 15:30:31

At least this one is a documentation issue. The Tutorial at http://umbraco.github.io/Belle/#/tutorials/Creating-Editors-Trees should describe '''package.manifest''' is a must.


Priority: Normal

Type: Bug

State: Obsolete

Assignee:

Difficulty: Normal

Category: Documentation

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.0.4

Due in version:

Sprint:

Story Points:

Cycle: