AngularJS 注入器无法解析所需的依赖项
AngularJS injector not able to resolve a required dependency
我打算使用 Angular ui 通知。当我托盘安装它时,浏览器告诉我 "Error: "[$injector:unpr]”。问题是对我来说依赖关系没问题。代码:
var app = angular.module('app', ['ngRoute', 'ngTable', 'ui-notification']);
app.controller('clientesController', ['$scope', 'NgTableParams', 'ui-notification', 'clientesService',
function ($scope, NgTableParams, Notification, clientesService) {
编辑:
我提取 js 文件的方式:
<!--Angular Files-->
<script src="app/lib/angular.min.js"></script>
<script src="app/lib/angular-route.min.js"></script>
<script src="app/lib/ng-table.js"></script>
<script src="app/lib/angular-ui-notification.min.js"></script>
<!-- App files-->
<script src="app/app.js"></script>
<script src="app/controllers/clientes/clientesController.js"></script>
<script src="app/services/clientes/clientesService.js"></script>
感谢您的帮助!
https://github.com/alexcrack/angular-ui-notification#service
Module name: "ui-notification"
Service: "Notification"
Configuration provider: "NotificationProvider"
然后将注入服务的名称更改为正确的名称:
app.controller('clientesController', ['$scope', 'NgTableParams', 'Notification'...
我打算使用 Angular ui 通知。当我托盘安装它时,浏览器告诉我 "Error: "[$injector:unpr]”。问题是对我来说依赖关系没问题。代码:
var app = angular.module('app', ['ngRoute', 'ngTable', 'ui-notification']);
app.controller('clientesController', ['$scope', 'NgTableParams', 'ui-notification', 'clientesService',
function ($scope, NgTableParams, Notification, clientesService) {
编辑: 我提取 js 文件的方式:
<!--Angular Files-->
<script src="app/lib/angular.min.js"></script>
<script src="app/lib/angular-route.min.js"></script>
<script src="app/lib/ng-table.js"></script>
<script src="app/lib/angular-ui-notification.min.js"></script>
<!-- App files-->
<script src="app/app.js"></script>
<script src="app/controllers/clientes/clientesController.js"></script>
<script src="app/services/clientes/clientesService.js"></script>
感谢您的帮助!
https://github.com/alexcrack/angular-ui-notification#service
Module name: "ui-notification"
Service: "Notification"
Configuration provider: "NotificationProvider"
然后将注入服务的名称更改为正确的名称:
app.controller('clientesController', ['$scope', 'NgTableParams', 'Notification'...