Unable to hide the navigation bar in login page when redirecting from home page to login page

↘锁芯ラ 提交于 2019-12-11 14:42:18

问题


I am trying to implement a sample app in Angular using Angular Material and Angular Flex Layout.

I have implemented a navigation bar which is hidden in login page and visible in all pages in the appllication.

I have created a service with the name showmenu.service.ts where I have declared two variable and assigned them as boolean..

I am able to hide the navigation bar in my login page as start my application. But as I login in to the application, I am getting the following error in my console as shown below.

I am unable to find out the problem..And also when I am trying to logout I am again getting the Navigation bar in my login page as shown below.

can anybody help me out with this issue....?

Please access my sample app here


回答1:


Try to use [hidden] instead if *ngIf. I had this same problem some months ago and it resolved to me. So it should solve your error.

So use this [hidden]="showmenu.visible1" instead of *ngIf="showmenu.visible1"


And kindly check angular 2 - how to hide nav bar in some components how it is works for show/hide menus by using service and compare with your code...



来源:https://stackoverflow.com/questions/50374160/unable-to-hide-the-navigation-bar-in-login-page-when-redirecting-from-home-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!