Closed davefmoore closed 7 years ago
+1
+2
It is described in documentation how to alter directive behavior. One possibility is to extend implementation to choose at app configuration stage the option between ng-hide, ng-if or custom one.
On Mon, 27 Feb 2017, 13:15 Denis, notifications@github.com wrote:
+2
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Narzerus/angular-permission/issues/387#issuecomment-282766823, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjeASXlqoijxxYpQxUloDoQyOwj7iE8ks5rgvaegaJpZM4MFhr7 .
Hello ;) Its not cool to add permission-on-authorized, permission-on-unauthorized on every element. I think $element.remove() should be out the box instead of $element.addClass('ng-hide').
It seems that "permission-on-unauthorized" attribute doesnt work with "ng-include" directive. Got error TypeError: permission.onUnauthorized(...) is not a function at onUnauthorizedAccess.
"angular" : 1.6.2, "angular-permission" : 3.2.1
@krasavchegUa It is because ng-include has higher priority of execution. Use permission directive on the wrapping element of ng-include. Additionally this is not related directly to the subject of the issue.
Awesome!!!
So, has someone edited the behavior so it works like ng-if or with ng-if?
Provide an option to use ng-if vs show/hide, or make ng-if the standard. I believe there are many benefits to this if you are using a component based architecture. From preventing viewing the html in the DOM to preventing http calls/ extra watchers. ie. dashoard with user components and admin components...