Error: [ng:areq] from angular controller

后端 未结 20 2170
攒了一身酷
攒了一身酷 2020-11-27 17:39

This is a long shot, but has anyone seen this error before? I am trying to add \'Transporters\' using express, angular and mongoDB. I get this error whenever I access a page

20条回答
  •  情话喂你
    2020-11-27 18:31

    There's also another way this could happen.

    In my app I have a main module that takes care of the ui-router state management, config, and things like that. The actual functionality is all defined in other modules.

    I had defined a module

    angular.module('account', ['services']);
    

    that had a controller 'DashboardController' in it, but had forgotten to inject it into the main module where I had a state that referenced the DashboardController.

    Since the DashboardController wasn't available because of the missing injection, it threw this error.

提交回复
热议问题