【发布时间】:2019-01-17 23:05:52
【问题描述】:
我想在我的 Angular 7 应用程序中使用 bootstrap-notify。
为此,我安装了bootstrap-notify 包(以及@types/bootstrap-notify)。
在我想要使用通知的组件中,我像这样导入了 jQuery 服务:
import * as $ from 'jquery';
现在称为notify,如文档中所述here:
$.notify({
// options
message: 'Hello World'
},{
// settings
type: 'danger'
});
问题是我得到了这个错误:
ERROR in src/app/home/home.component.ts(28,7): error TS2339: Property 'notify' does not exist on type 'JQueryStatic'.
知道如何让它工作吗?我找不到任何使用此包的 Angular (5/6/7) 示例!
【问题讨论】:
-
另外,请考虑查看
ngx-toastr以获取在不导入 jquery 和 jquery 类型的情况下可以工作的非 jquery toast。
标签: angular notifications bootstrap-4 notify