Guido Caffa
Guido Caffa

Reputation: 1251

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!

Upvotes: 0

Views: 134

Answers (1)

Pop-A-Stash
Pop-A-Stash

Reputation: 6652

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'...

Upvotes: 1

Related Questions