Fernando Toress Fernando Toress - 4 months ago 14
AngularJS Question

ng-hide with two condition not working properly

ng-hide="template.created_by == 4 && $cookieStore.get('custom_role') != 4"

The condition not work properly .I couldn't show the button even the both values (template.created_by,$cookieStore.get('custom_role')) are 4.

Answer

If both of the values are 4 - then your condition will be resolved to falase. Make sure that you can see template and $cookieStorage from html, like this:

{{template}} 
{{$cookieStore}}

If you don't see them - you will need to adjust your scope.