Struggling to implement Foundation components like model and accordion menu in my project. Unfortunately, they are not functioning as expected.
import { Component, OnInit} from '@angular/core';
import { MenuItems } from '../../shared/menu-items';
import { Foundation } from 'node_modules/foundation-sites/js/foundation.core';
declare var $:any;
@Component({
selector: 'app-admin',
templateUrl: './admin.component.html',
styleUrls: ['./admin.component.scss']
})
export class AdminComponent implements OnInit {
isShrinkMedium: Boolean = true
menuItems;
constructor() { }
ngOnInit() {
Foundation.addToJquery($);
$(document).foundation();
this.menuItems = new MenuItems().getAll();
}
This is the component where I'm facing issues. The console shows errors like the ones below:
https://i.sstatic.net/Akzn8.png
When I click on the circled area in the image, I see the following message:
https://i.sstatic.net/pgZZ1.png
As a result, none of the Foundation components are working properly. Everything functioned correctly when using an older version (version 4). Hoping someone can shed light on what might be causing these problems.