问题
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