-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create example #2
Comments
Hi there, Awesome service you built out. I set the roles and abilities in my app.run and was able to get it working with my router. Now I am trying to use the AclService in other controllers, but the values don't carry over. How can I preserve the AclService to use across my app? This is an example of one of the controllers I am using: (function () {
var app = angular.module("mainApp");
function routeUserController($rootScope, $scope, $http, $location, AclService) {
$scope.can = AclService.can;
console.log($scope.can('view_map'));
console.log(AclService.hasRole('psAdmin'));
}
app.controller("RouteUserController", routeUserController);
}()); |
Theoretically, the code you are showing should work. It seems like you might have an issue elsewhere in your app. What values does the code you posted log out into the console? What values were you expecting? Can you also provide the |
Hey, Thanks for your reply and this awesome angular-acl module. I was running into something issues that ngRoute was giving me and migrated to ui-router instead. Now, everything is working much more smoothly, and the AclService is preserved across the app! Thank you, |
I use so , with ngRoute
throughout my app, template, I can use the acl calling dependent functions. so
or acl.hasRole('admin') , etc.. |
It is working fine for ui-router also. |
Hi,
I'm actually not the creator of the issue so I don't have permissions to
close it.
My apologies, I should have opened another Issue during that time and it
seemed to have tangent off quite a bit.
Best,
…On Wed, Jun 7, 2017 at 11:21 AM, Surendra Kumar B ***@***.***> wrote:
Hey @ariellav <https://github.com/ariellav>
Could you please close this issue if it works well for you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AH0WeV9xUVMBfc7eQq2ijW7vyCoT3io-ks5sBuoWgaJpZM4C0OTl>
.
--
|
No description provided.
The text was updated successfully, but these errors were encountered: