gpt4 book ai didi

Angular 6 : Cannot read property 'runOutsideAngular' of undefined

转载 作者:太空狗 更新时间:2023-10-29 18:12:26 26 4
gpt4 key购买 nike

我已经通过此命令使用 cli 创建了 nav-bar

ng g @angular/material:material-nav --name=version-nav

并在我的组件中导入为

<app-version-nav></app-version-nav>

得到这个错误

enter image description here

任何有帮助的建议将不胜感激

最佳答案

你可以在tsconfig.js中将target改成es5

{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
}
}

关于 Angular 6 : Cannot read property 'runOutsideAngular' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52166617/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com