Hi You can create new directives, named according to the control you want to override. For example if you want to disable button HTML element based on user right, you can create a button directive that will set the disabled attribute based on your User service.
Manu @EmmanuelDemey Le 3 sept. 2015 14:20, "nideesh manian" <[email protected]> a écrit : > I have single page application built using ng-views, It also has some > reusable components in the form of custom directives.I want to enable or > disable controls based on the logged in user. How can we do this? > I have a json list of control ids related to each used. I need to enable > only those controls and disable others. > There are many pages and each page have various buttons, textboxes and so > on. > > I was thinking of adding a filter/ng-show to each control, but from > maintenance perspective it is bad. > > > > > -- > You received this message because you are subscribed to the Google Groups > "AngularJS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
