1
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 does not work well, I am putting on each menu item an ng-show:
ng-show="permissaoUser"
And in the Menu Controller:
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 happens that the menu only presents according to the user SE der F5 in the BROWSER that is where I follow the development.
However, the emulator or the device does not work.
Anyone can help?
Thank you.
Why not send these menus, in vector form, to your application. Then, create a directive that assembles the menu according to this vector. I believe that to treat this in the backend would be more sensible and easier.
– Gilson Reis