angularjsangularjs-injector

AngularJS injector not able to resolve a required dependency


I'm traying to use Angular ui Notifications. When I tray to install it browser tells me "Error: "[$injector:unpr]". The problem is that for me the dependencies are ok. The code:

var app = angular.module('app', ['ngRoute', 'ngTable', 'ui-notification']);

app.controller('clientesController', ['$scope', 'NgTableParams', 'ui-notification', 'clientesService',

    function ($scope, NgTableParams, Notification, clientesService) {

EDIT: The way I'm pulling in my js files:

<!--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>

Thanks for your help!


Solution

  • https://github.com/alexcrack/angular-ui-notification#service

    Module name: "ui-notification"

    Service: "Notification"

    Configuration provider: "NotificationProvider"

    Change then name of the injected service to the correct name:

    app.controller('clientesController', ['$scope', 'NgTableParams', 'Notification'...