【发布时间】:2022-02-01 12:01:20
【问题描述】:
此故障仅在 Angular 11 应用程序中使用“ng test”而不是“ng build”或“ng serve”的测试模式下出现。我尝试了所有可用的解决方案,但没有人为我工作。
jquery的component.ts相关代码
declare var $: any;
angular.json 包含脚本和样式
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/angular-app",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/assets/css/jquery-ui.min.css",
"src/assets/css/style.css"
],
"scripts": [
"./node_modules/jquery/dist/jquery.min.js",
"./node_modules/popper.js/dist/umd/popper.min.js",
"./node_modules/bootstrap/dist/js/bootstrap.js",
"src/assets/js/jquery-ui.min.js",
"src/assets/js/sidebarResponsive.js"
]
【问题讨论】:
标签: angular