mikemclin / angular-acl

Role-based permissions for AngularJS
196 stars 49 forks source link

$q is not defined #6

Closed cdiaz closed 9 years ago

cdiaz commented 9 years ago
.when('/manage', {
  resolve : {
    'acl' : function(AclService){
      if(AclService.can('manage_content')){
        // Has proper permissions
        return true;
      } else {
        // Does not have permission
        return $q.reject('Unauthorized');
      }
    }
  }
});
LalitPatadiya commented 9 years ago

@cristiamdiaz :have you got solution of $q not defined..?

LalitPatadiya commented 9 years ago

I have same issue, how may i resolved can you please help me..?

mikemclin commented 9 years ago

Sorry, appears to be a typo in the README example. Does this work for you?

.when('/manage', {
  resolve : {
    'acl' : ['$q', 'AclService', function($q, AclService){
      if(AclService.can('manage_content')){
        // Has proper permissions
        return true;
      } else {
        // Does not have permission
        return $q.reject('Unauthorized');
      }
    }]
  }
});
LalitPatadiya commented 9 years ago

Thank you @mikemclin now it's working fine.