AngularJS error: [$ injector: itkn] Invalid input token! Expected service name as string, got undefined

Trying to start an Angular app containing this controller:

routerApp.controller('chartSettingsCtrl', ['$scope', '$timeout', 
 , function($scope, $timeout) { /* body omitted */ }

      

gives me an error:

Error: [$injector:itkn] Incorrect injection token! Expected service name as string, got undefined

      

What am I doing wrong?

+3


source to share


1 answer


The actual problem is that I had an extra one in the controller ,

. When I changed this it worked.

FROM

routerApp.controller('chartSettingsCtrl', ['$scope', '$timeout',
 , function($scope, $timeout) {

      



For

routerApp.controller('chartSettingsCtrl', ['$scope', '$timeout',
 function($scope, $timeout) {

      

+46


source







All Articles