Skip to content Skip to sidebar Skip to footer

The Controller With The Name Xxx Is Not Registered - Refactoring Old Project That Uses Webpack

I'm currently refactoring one of my old AngularJS projects which worked before, but since updating the dependencies, has stopped working. I'm getting an error in the console that s

Solution 1:

Only the first module declaration should have dependencies specified.

ERRONEOUS

angular.module('qaDashboard', ['restangular'])
.controller('NavigationCtrl',NavigationCtrl) 

angular.module('qaDashboard', ['restangular'])
.component('environments', {/* ... */})

Declaring dependencies again will cause the controller to be unregistered.

Correct

 angular.module('qaDashboard', ['restangular'])
.controller('NavigationCtrl',NavigationCtrl) 

 angular.module('qaDashboard')
.component('environments', {/* .. */})

For more information, see

Post a Comment for "The Controller With The Name Xxx Is Not Registered - Refactoring Old Project That Uses Webpack"