I am attempting to integrate the twitter-bootstrap-wizard JavaScript library into my Angular 2
project, but I keep encountering the following error:
WEBPACK_MODULE_1_jquery(...).bootstrapWizard is not a function
I have created a new Angular app using angular-cli 1.0.0
and added the necessary scripts in the index.html like so:
<body>
<app-root>Loading...</app-root>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap-wizard/1.2/jquery.bootstrap.wizard.js"></script>
</body>
Then in my component:
//
declare var bootstrapWizard : any;
import * as $ from 'jquery';
//
ngAfterViewInit() {
(<any>$('#wizard')).bootstrapWizard()
}