Currently, I am exploring the integration of the Bootstrap 3.3.7 popover component (since I cannot use the ng version) into a new Angular 4 application. To achieve this, I initially installed:
npm install --save jquery @types/jquery bootstrap
Following that, I included the necessary CSS and scripts in angular-cli.json file:
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.css",
"../node_modules/bootstrap-tour/build/css/bootstrap-tour.css",
"styles.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.js",
"../node_modules/bootstrap/dist/js/bootstrap.js",
"../node_modules/bootstrap-tour/build/js/bootstrap-tour.js"
]
Then, within the typings.d.ts file, I defined an interface as follows:
interface Jquery {
popover(...any) : any;
}
Afterwards, I imported jQuery into my component using the code snippet below:
import * as $ from "jquery"
However, upon attempting to execute the popover method, I encountered a compilation error:
('#test1').popover('show'); // An error is triggered here for the popover method.
How can TypeScript be configured to recognize it properly?