I have a very simple Angular controller set up, but the code inside its constructor isn't running. Here are the relevant pieces:
conversationcontrollers.js:
var exampleApp = angular.module('exampleApp',[]);
console.log('file loaded');
exampleApp.controller('ConversationController', ['$scope',
function($scope) {
console.log('controller constructor loads');
}
]);
conversation.html:
...
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
<script src='/static/js/conversationcontrollers.js'></script>
...
<div ng-controller="ConversationController">
</div>
...
The files both load correctly according to the browser. But the only results from the console are:
file loaded
Can anyone help?
ng-appdeclared in conversation.html?ng-app[]parameter. If conversation.html is a partial loaded inng-view, you may want to be using the parent angular module.