首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >切换和模态在Angular应用程序上不起作用

切换和模态在Angular应用程序上不起作用
EN

Stack Overflow用户
提问于 2019-05-30 12:27:38
回答 1查看 560关注 0票数 0

我是Angular的新手,在使用Bootstrap切换和Modal时遇到了一些问题。BootStrap CSS文件之所以能正常工作,是因为表单采用了样式;但是,我认为JS文件没有正确链接。请让我知道我在做什么工作。

我使用Angular CLI对BootStrap和jQuery进行了NPM安装。安装后,我将BootStrap和jQuery文件链接到angular.json文件,以便应用程序能够使用库。

代码语言:javascript
复制
"build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/LyndaChapter1",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            **"styles": [
              **"node_modules/bootstrap/dist/css/bootstrap.css",
              "src/styles.css"**
            ],
            "scripts": [
              "node_modules/bootstrap/dist/js/bootstrap.js",
              "node_modules/jquery/dist/jquery.js"
            ],**
            "es5BrowserSupport": true
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                }
              ]
            }
          }
        },

预期结果:切换和模态应该起作用实际结果:两者都不起作用

EN

回答 1

Stack Overflow用户

发布于 2019-05-30 13:15:05

尝试将这些包添加到您的package.json文件中,并在Package.json文件级运行npm install --save命令。

/* "@ng-bootstrap/ng-bootstrap":"^4.1.0","bootstrap":"^4.3.1“*/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56371627

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档