让toubles将bootstrap4切换到angular 8

让toubles将bootstrap4切换到angular 8,angular,bootstrap-4,Angular,Bootstrap 4,我是Angular的新手,正在尝试从以下来源导入bootstrap4切换: 向我的项目添加切换复选框:) 我运行了npm安装,在packjage.json中找到了项目中的包,现在我需要将它添加到“styles”中,但我不知道要添加什么,我已经尝试过了 "styles": [ "node_modules/bootstrap/dist/css/bootstrap.min.css", "node_modules/bootstrap4-toggl

我是Angular的新手,正在尝试从以下来源导入bootstrap4切换: 向我的项目添加切换复选框:) 我运行了npm安装,在packjage.json中找到了项目中的包,现在我需要将它添加到“styles”中,但我不知道要添加什么,我已经尝试过了

 "styles": [
              "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "node_modules/bootstrap4-toggle/css/bootstrap4-toggle.min.css",
              "src/styles.css",
              "node_modules/font-awesome/css/font-awesome.css"
            ],
但它不起作用。。。 我在导航栏上用过这个标签

<input type="checkbox" checked data-toggle="toggle">


它应该看起来像一个切换按钮,而不是一个普通的html复选框。

在angular.json的脚本和样式中添加导入

"styles": [
    "src/styles.css",
    "node_modules/bootstrap4-toggle/css/bootstrap4-toggle.min.css"
],
"scripts": [
    "node_modules/bootstrap4-toggle/js/bootstrap4-toggle.min.js"
]

你怎么知道它不起作用?你收到错误信息了吗?请尽可能多地分享详细信息。也许您应该使用标准的纯css,并避免在应用程序中添加对jQuery的依赖:您还需要在脚本下导入bootstrap4-toggle.min.js。@jbniset,hbamithkumara-这两个建议都有效,谢谢@错误86-似乎有人发布了答案,您接受了答案。请不要将你的问题编辑为“已解决”,或将解决方案放在问题中-这不是问题所在,这些都是对问题的无效编辑。如果你想发布一个额外的答案,除了发布的答案之外,还有一些细节,那就太好了。像这样的我回滚了您上次的编辑。