Show bootbox alert in Typescript/Angular2? [closed]

假如想象 提交于 2019-11-30 20:54:38
vikas

Step 1: Install bootbox via npm install bootbox --save

Step 2: If you are using systemjs then include bootbox like:

<script src="node_modules/bootbox/bootbox.js"></script>

Step 3: Just put declare var bootbox:any; after import all libreries and before component decorator in your component ts file and then use normaly like bootbox.alert("Hello world!"); on any function call.

Make sure you have bootstrap and jquery installed and included in index page. jquery should be in first place then after bootstrap.

[Edit]

Alternate Step 3 Instead of declare var bootbox:any;, import type type definitions instead:

npm install @types/jquery --save
npm install @types/bootbox --save
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!