-
Notifications
You must be signed in to change notification settings - Fork 346
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
Use ng-if instead CSS #98
Comments
Hey, and thanks for the proposal and code :) |
Thanks for your answer. Yeah of course that all client-side technologies are exposed to user manipulation. However, changing the visibility of an element using breakpoints and hacking the link function could be considered an attack and the rest of your app should be prepared to handle that cases. What i'm concerned is to accidentally write a CSS rules for the app that makes elements visible even when is supposed to be hidden. And beyond of punctual cases, this issue is more related to the separation of concerns. CSS contains the presentation layer of the site. Logic aspects should be handled by JavaScript. |
I agree with @alb3rto. I think that using another directive is redundant anyway. |
The code that I proposed is an update for the current |
Okay, thanks for having the patience with me to explain more in detail :) I see your point, and agree it's better to use the ngIf directive rather than manipulating the CSS properties directly. If you submit a Pull Request, I'll be happy to accept. |
First of all: This project is awesome.. Thanks!!
The only part I dislike is the "accessLevel" directive. There, you show or hide elements according the authorize method. However, in terms of security (which is the key in this project) delegate the visibility of elements to CSS is not the better choice.
My workaround was use the ngIf directive to give a more professional behaviour.
As you can see, the logic is pretty close your original directive and the directive structure is delegated to ngIf.
Btw, this solution is based on this: http://stackoverflow.com/questions/20325480/angularjs-whats-the-best-practice-to-add-ngif-to-a-directive-programmatically
Let me know what do you think.
The text was updated successfully, but these errors were encountered: