【发布时间】:2018-02-19 04:48:50
【问题描述】:
有没有办法使用 bootstrap 4 中的工具提示功能?
我们已经使用 npm install 安装了 bootstrap 4、tether 和 jquery,
在文档中我们必须用 javascript 编写 jquery 代码,
$(function () [
$('[data-toggle="tooltip"]').tooltip()
})
并在 html 中添加此代码,
data-toggle="tooltip" data-placement="top" title="Tooltip on top"
我们尝试添加 html 代码但不起作用,显然我们必须编写 jquery 代码,但是我们可以使用 typescript 在 angular 4 中编写 jquery 语法吗? 那么 Angular 4 中的语法应该放在哪里呢?
【问题讨论】:
-
添加 ng-bootstrap 并且它们具有适用于所有人的组件。您可以直接使用它们
-
Jquery 和 Angular 不能很好地配合使用。也许您可以使用 ng-boostrap 或其他库,例如 ngx-popover
-
是的,jQuery 和 Angular 都不是很好。对于本机工具提示实现检查ng-bootstrap.github.io/#/components/tooltip/examples
标签: jquery angular typescript bootstrap-4