Question

I am unable to get my controller linked to my view. If I include the view using ng-view and have the controller name in the route, the transclusion fails in Angular-route.js when it trys to link in the ngViewFillContentFactory. If I use the ng-controller attribute in the view itself, it fails in angular.js on the boundTranscludeFn that binds the controller to the view. In both cases I can see the application and the 'shell' controller are loaded into the DOM. In both cases the error message "Argument 'shell' is not a function".

The ng-app tag is set in the html tag to the name of the application. Why can the application not find the controller? What tiny little detail am I missing? Controller loaded in the application controllers collection

Here is the error message (I am calling the controller on two different divs) and here is the controller function loaded into the angular controllers collection.

The ng_app attribute is set to "cockpit" in the html tag and in both cases now I am using the router to assign the shell controller to both the view and the ng-included partial. The same thing happens if I assign the ng-attribute tag to "shell" in shell.html only the error occurs in another part of the code.

I am trying to put together a test app to reproduce the problem which I can post on git.

Was it helpful?

Solution

So the problem was how I was constructing my module. I can't tell you exactly what I did wrong because I don't yet understand exactly how modules work. What I did was to reduce the application down until I got it to work and added things back one by one until I found the thing that broke the app.

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