arkon / ng-sidebar

[Inactive] Angular sidebar component.
https://echeung.me/ng-sidebar
MIT License
388 stars 136 forks source link

Can't nest components inside ng-sidebar #199

Closed gabriel-gn closed 4 years ago

gabriel-gn commented 4 years ago

Is it possible to put components inside ng-sidebar-content? I've been trying without success...

ng-sidebar seems to seems to always push content of app-content. Below my code.

<ng-sidebar #sidebar >
    <div ng-sidebar-content>
       <app-content></app-content>
    </div>
</ng-sidebar-container>
arkon commented 4 years ago

Are you sure your code is right? It seems to be missing the opening tag for the container and the closing tag for the sidebar.

gabriel-gn commented 4 years ago

Sorry, my code is a bit messy. Below it more readable:

<app-navbar></app-navbar>
<ng-sidebar-container style="height: 100vh;">

    <ng-sidebar #sidebar 
    [opened]="sidebarOpened" 
    [dock]="true" 
    [dockedSize]="'40px'" 
    [mode]="'push'"
    [position]="'left'"
    [closeOnClickOutside]="false">
    <!-- Sidebar content  -->
   </ng-sidebar>

   <div ng-sidebar-content>
      <app-content></app-content>
    </div>

</ng-sidebar-container>
arkon commented 4 years ago

It's hard to tell without actually being to see the site. Your best bet would be poking around in dev tools to see why it's pushing things.

gabriel-gn commented 4 years ago

Thanks. I'll try to debug it, it's probably not a problem with the module