I'm trying to capture the event of opening and closing the bootstrap accordion, but with the typescript the events are not "listened to", but with JS it works fine!
ERROR:
module "c:/Users/THIAGOSAAD/Documents/DEVELOPMENT/NEORIS/ALIANSCE/appcomercial/build/typescript/types/jquery"
This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export.ts(2497)
JQUERY TYPES
export = jquery;
declare function jquery(w: any): any;
CLASS
import * as $ from '../types/jquery';
export class BootstrapAccordionController {
private readonly _iconStateContainer: HTMLElement;
public constructor(private readonly _accordionID: string, public readonly iconStateContainerID: string) {
this._iconStateContainer = document.getElementById(iconStateContainerID);
}
public init(): void {
try {
this.changeIconState();
} catch (error) {
console.error(error);
}
}
private changeIconState(): void {
$(`#${this._accordionID}`).on('shown.bs.collapse', () => this.createIconState('shown.bs.collapse'));
$(`#${this._accordionID}`).on('hidden.bs.collapse', () => this.createIconState('hidden.bs.collapse'));
}
private createIconState(_stateType: string): void {
switch(_stateType) {
case 'shown.bs.collapse':
this._iconStateContainer.innerHTML = `
`
break;
case 'hidden.bs.collapse':
this._iconStateContainer.innerHTML = `
`
break;
}
}
}
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)