Error: [$ compile: multidir] Several directives [statbox, statbox] requesting a template:
(On the console)
Inside index.html
<script src="js/dashboard/dashboard.module.js"></script> <script src="js/dashboard/dashboard.component.js"></script> <script src="js/dashboard/statbox.component.js"></script>
Inside dashboard.module.js
var dashboardModule = angular.module('dashboard', ['ngRoute']);
Inside dashboard.component.js
angular.module('dashboard').component('dashboard', { templateUrl: 'templates/dashboard/dashboard.template.html', controller: ['$scope', '$routeParams', '$http', '$rootScope', '$log', function DashboardController($scope, $routeParams, $http, $rootScope, $log) { ...stuff NOT REFERENCING STATBOX by any means... }] });
Inside statbox.component.js
angular.module('dashboard').component('statbox', { templateUrl: 'templates/dashboard/statbox.template.html', controller: ['$http', '$rootScope', '$log', function StatboxController($http, $rootScope, $log) { ... some random get request ... }] });
And inside app.js
var app = angular.module('buttonMasher', ['ngRoute', 'dashboard', ...]);
Inside dashboard.template.html
... stuff ... <div id="history"> ... stuff ... <p><b>Statbox</b></p> <statbox></statbox> </div>
Inside statbox.template.html
<div id="statbox"> <p>{{$ctrl.statboxText}}</p>
What am I doing wrong and why am I getting this error with several directives?
Whenever I comment <script src="js/dashboard/statbox.component.js"></script> from index.html everything works, but the statbox controller does not load.
(The full project is here: Github: carloworks / masher - You can clone and run spring with the "dev" profile enabled.)