如何导入 clear-bootstrap 到 Angular 4?

How to Import jasny-bootstrap to Angular 4?

贾斯尼 Bootstrap:

https://github.com/jasny/bootstrap

已安装:npm install jasny-bootstrap --save

app/app.module.tsmain.ts

中导入

import * as jasny from 'jasny-bootstrap';

我收到这个错误:

ERROR in /Users/Roller/Working/Angular4/src/app/app.module.ts (11,24): Cannot find module 'jasny-bootstrap'.

jasny-bootstrap 不是 Angular 模块,它只是 javascript 库。如果您使用 angular-cli,您可以将此脚本包含在您的 .angular-cli.json 文件中。你就是这样做的:

"scripts": [
    "../node_modules/jquery/dist/jquery.min.js",
    "../node_modules/bootstrap/dist/js/bootstrap.min.js"
]

css 个文件也一样:

"styles": [
    "../node_modules/bootstrap/dist/js/bootstrap.min.css"
]