I'm having trouble getting a basic app and controller working, although I've used this pattern many times before without issues.
Here's the relevant part of my front-end template (I'm using jinja2 with a Python webapp2 backend):
{% block js %}
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js"></script>
<script src="/static/js/widget-controller.js"></script>
{% endblock %}
{% block widgetbody %}
<body class="partner_widget" ng-app="PartnerWidgetApp">
<div id="header">Recommended Wired Expert</div>
<div class="body">
<div id="expert_content">
<figure class="headshot">
<img src="{{ expert_user_profile_image }}" />
</figure>
<div class="description" ng-controller="PartnerWidgetController">
<div ng-include="'/static/angular-partials/widget/partner_widget_description.html'">
</div>
</div>
</div>
<div id="action_content">
<a href="#" id="cta">Here's the CTA</a>
</div>
</div>
{% endblock %}
Here's my AngularJS file:
var PartnerWidgetApp = angular.module('PartnerWidgetApp');
PartnerWidgetApp.controller('PartnerWidgetController', ['$scope',
function($scope) {
$scope.description_text = "this is test text that you should see";
}
]);
Here are the contents of the included "/static/angular-partials/widget/partner_widget_description.html" file:
{{ description_text }}
And here are my errors in the console:
Uncaught Error: No module: PartnerWidgetApp angular.min.js:17
Error: Argument 'PartnerWidgetController' is not a function, got undefined
at Error (native)
at eb (http://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js:16:466)
at va (http://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js:17:33)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js:53:60
at http://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js:44:43
at o (http://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js:7:43)
at l (http://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js:43:408)
at e (http://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js:39:419)
at e (http://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js:39:436)
at e (http://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js:39:436)
To my knowledge, the Angular library and my files are being loaded correctly, and the names of the app and controller are consistent with their assignments in the template. Can anyone help diagnose this issue? Thanks for any help.
var PartnerWidgetApp = angular.module('PartnerWidgetApp', []);fix the problem? I've always included the empty array in the module line, even if no plugins are being loaded.