Unknown Provider: Permpermissionstoreprovider

Asked

Viewed 367 times

0

After installing the package through Bower, it is not recognized in the project. Follows the code:

installation command: Bower install angular-permission --save (I have tried installing by npm as well, but without success)

code where I use the service:

(function() {

'use Strict';

angular
    .module('project')
    .factory('UserSession', UserSession);

function UserSession($q, AuthServer, PermPermissionStore) {

    //... outros códigos

    function getAccountThen (account) {
                authenticate(account.data);

                if(account.data === "") {
                    return getAccountCatch();
                }

                var perfis = _account.perfil.map(function(p) { return p.cdPerfil });
                PermPermissionStore.clearStore();
                PermPermissionStore.defineManyPermissions(perfis, hasAuthority);

                _account = account.data;
                _authenticated = true;
                deferred.resolve(_account);
            }

    //... outros códigos

}

})();

The same code is used in other projects and works perfectly.

Error stack:

Uncaught Error: [$injector:unpr] Unknown provider: PermPermissionStoreProvider <- PermPermissionStore <- UserSession <- AuthService

http://errors.angularjs.org/1.5.6/$injector/unpr? P0=Permpermissionstoreprovider%20%3C-%20PermissionStore%20%3C-%20UserSession%20%3C-%20AuthService at angular.js:68 at angular.js:4501 At Object.getService [as get] (angular.js:4654) at angular.js:4506 at getService (angular.js:4654) at injectionArgs (angular.js:4678) At Object.invoke (angular.js:4700) At object.enforcedReturnValue [as $get] (angular.js:4547) At Object.invoke (angular.js:4708) at angular.js:4507

What could possibly be causing the error? I already ran 'Gulp clean && Gulp build && Gulp and nothing. I’ve already closed the text editor and opened it, and nothing.

From now on I appreciate any help.

1 answer

0

Permission needed to be added to the main module (app.module.js). Lack of attention.

'permission',
'permission.ui',

Browser other questions tagged

You are not signed in. Login or sign up in order to post.