I followed the bootstrap way and added the demo example from https://getbootstrap.com/docs/3.3/javascript/#via-data-attributes-1 into my angular app inside a navbar.
This did not work out of the box as toggling the dropdown had no effect. After reading further I came acrosss activating the dropdown via javascript. https://getbootstrap.com/docs/3.3/javascript/#via-javascript-1
I executed $('.dropdown-toggle').dropdown() in the Browser and voila the Dropdown worked as expected. Now I wanted to add this JavaScript call to the OnInit block of my header component like this:
ngOnInit(): void {
$('.dropdown-toggle').dropdown();
}
Unfortunately this does not work, as the compiler complains with:
ERROR in src/app/header/header.component.ts(16,27): error TS2339: Property 'dropdown' does not exist on type 'JQuery'.
Jquery should work, as it is included in my package.json "@types/jquery": "^3.3.0" and bootstrap version is "bootstrap": "^3.3.7",