Hello, I have two types of users: buyer and seller.
How to display a menu according to the type of user logged in with Ionic / Angularjs?
Currently, and it does not work well, I'm putting in every menu item an ng-show:
ng-show="permissaoUser"
And in the Menu Controller I do:
if($window.localStorage.getItem("user_cod_cliente") === null){
$scope.permissaoUser = false;
}else{
$scope.permissaoUser = true;
}
if($window.localStorage.getItem("global_fornecedor") === null){
$scope.permissaoVovo = false;
}else{
$scope.permissaoVovo = true;
}
That is, I get the information saved in my LocalStorage after login.
It turns out that the menu only shows according to the user SE of F5 in the BROWSER that is where I follow the development.
BUT, the emulator or the device does not work.
Can anyone help?
Thank you.