I'm using latest version of Require and Angular, but i encountered strange bug. I have controller for every view, but apparently works only for one view. This is my example code:
Define all controllers: Controllers.js
define([
'modules/index/controller',
'modules/test/controller'
], function(){});
Here works only with one controller, if i include 2 like here i get Error: ng:areq Bad Argument
Index: controller.js
define(['angular'], function(angular){
'use strict';
return angular.module('myApp.controllers', [])
.controller('indexCtrl', ['$scope' , function ($scope){
alert("index ok");
}]);
});
Test: controller.js
define(['angular'], function(angular){
'use strict';
return angular.module('myApp.controllers', [])
.controller('testCtrl', ['$scope' , function ($scope){
alert("test ok");
}])
});
Where i'm wrong?