Topic: SideNav Creation from Array
                  
                  modernwebdesign
                  priority
                  asked 7 years ago
                
                Hello,
I am trying to generate the Sidemenu from an Array in my menu.component.ts. This was already working on Top Navigation but now I get the following error message
 
Did anybody has an idea how to fix this?
                
                
                
                  
                  
                  
                    
                    
                
              
              
              
            [Error] ERROR – TypeError: undefined is not an object (evaluating 'this.body.toggle')This is my HTML
<mdb-accordion-item *ngFor="let item of menuitems" [ngClass]="{'no-collase': item.submenu.length == 0}">
<mdb-accordion-item-headmdbWavesEffect>
<fa-icon[icon]="item.icon"class="icon"></fa-icon> {{ 'webapp.menu.' + item.key | translate:lang }}
</mdb-accordion-item-head>
<mdb-accordion-item-body*ngIf="item.submenu.length != 0">
<ul>
<li*ngFor="let subitem of item.submenu">
<aclass="nav-link waves-light"mdbWavesEffectrouterLink="{{subitem.routerlink}}">
<fa-icon[icon]="subitem.icon"class="icon"></fa-icon>
<spanclass="clearfix d-none d-sm-inline-block">{{ 'webapp.menu.' + subitem.key | translate:lang }}</span>
</a>
</li>
</ul>
</mdb-accordion-item-body>
</mdb-accordion-item>
and this is my Array
menuitems:any[] = [
{key: "dashboard", routerlink: "/settings", icon: this.faDashboard, submenu: []},
{key: "settings", routerlink: "/settings", icon: this.faCog, submenu: []}
];
                
                  
                      
                        Add comment
                      
                    
                  
                
                      
                      Damian Gemza
                      staff
                        answered 7 years ago
                    
                    Dear modernwebdesign,
Thanks for your report! Your problem will be fixed with the next release of MDB Angular. But if you need it now, you can obtain it by installing the latest developer version of MDB Angular library using command:
                    
                    
                    
                    
                  
                  
                npm install git+https://oauth2:<your-token>@git.mdbootstrap.com/mdb/angular/ng-uikit-pro-standard.git#dev --saveBut please be aware that #dev is a branch on which we're currently working. So it may contain some bugs which We haven't discovered yet. Best Regards, Damian
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
              Resolved
Specification of the issue
              - ForumUser: Priority
 - Premium support: Yes
 - Technology: MDB Angular
 - MDB Version: 6.2.2
 - Device: PC
 - Browser: Safari
 - OS: Mac OSX 10.14
 - Provided sample code: Yes
 - Provided link: No