Unable to hide the navigation bar in login page wh

2019-09-02 20:35发布

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.

enter image description here

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.

enter image description here

enter image description here

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

Please access my sample app here

1条回答
看我几分像从前
2楼-- · 2019-09-02 21:12

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...

查看更多
登录 后发表回答