How to work with Angular Primeng Slidebar?

Asked

Viewed 273 times

0

Look at the two components:

Sidebar

Menu - Panelmenu

First I’ll show you how the application is behaving, then I’ll show you what I’m trying to implement.

The system is behaving like this;

The button to click and the menu appears.

inserir a descrição da imagem aqui

By clicking on the menu the button disappears and the menu appears.

inserir a descrição da imagem aqui

What I need to do is that when I click on the button the menu appears, but keep showing the button and when I click on the button again the menu disappears, but continuing to show the button

But I don’t know how to do this because I’m new as an Angular programmer and need help.

Here is my code:

<div class="container">

<p-sidebar [(visible)]="display" >
    <p-panelMenu [model]="items" [style]="{'width':'300px'}"></p-panelMenu>
</p-sidebar>

<button type="text" (click)="display = true" pButton icon="fa-external-link-square" label="Show"></button>

</div>

For those who want to have access to my project this is my repository;

REPOSITORY

  • If the CSS: button { z-index: 1; } does not solve? If it does not work, increases the number, remembering that the style will attack all buttons, then the ideal is to define a id or class.

  • did not solve the problem, unfortunately.

  • I believe this has nothing to do with css, you know how to handle Angular?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.