Error: Unknown provider: employeesProvider <- employees

后端 未结 2 522
没有蜡笔的小新
没有蜡笔的小新 2020-12-10 13:12

I am having a heck of a time trying to figure out why I\'m getting the Unknown provider error in Angular. I\'ve checked every other question I could find on the subject and

2条回答
  •  难免孤独
    2020-12-10 13:23

    Since you defined the factory called Employee, you should use the exact name to refer to this module when you inject it to the controller.

    var employeeCtrl = app.controller('EmployeeCtrl', [
          '$scope',
          'employees',
    

    Change to

    var employeeCtrl = app.controller('EmployeeCtrl', [
          '$scope',
          'Employee',
    

提交回复
热议问题