我有一个应用程序,我想提取它的两个版本。
首先是包含整个应用程序的构建。
第二个是一个仅包含我的模块之一的应用程序。它还有一个单独的路由模块。
我使用文件替换来分离构建,以定义一种新的构建方式angular.json。
替代品是这些:
"fileReplacements": [
{
"replace": "projects/my-app/src/environments/environment.ts",
"with": "projects/my-app/src/environments/environment.prod.ts"
},
{
"replace": "projects/my-app/src/app/app.module.ts",
"with": "projects/my-app/src/app/app-auth-standalone.module.ts"
},
{
"replace": "projects/my-app/src/app/app-routing.module.ts",
"with": "projects/my-app/src/app/app-auth-standalone-routing.module.ts"
},
{
"replace": "projects/my-app/src/app/app.component.ts",
"with": "projects/my-app/src/app/app-auth-standalone.component.ts"
}
]
Run Code Online (Sandbox Code Playgroud)
现在,当我运行它时,ng run my-app:auth-standalone:production它会出现以下错误:
Error: <some-path>/message-bot.component.html:24:34 - error NG8002: Can't bind to 'control' since it isn't a known property of 'app-bot-view-tr
ansfer-to-user'.
1. If 'app-bot-view-transfer-to-user' is an Angular component and it has 'control' input, then verify that it is part of this module.
2. If …Run Code Online (Sandbox Code Playgroud) 错误内容:
Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Run Code Online (Sandbox Code Playgroud) 我正在尝试一步一步地完成任务。
我的方法中有一个 for 循环:
async changeTimeStep3() {
for (let i = 1; i < 10; i++) {
await this.do(i)
}
}
Run Code Online (Sandbox Code Playgroud)
每一步都必须执行 do() 任务。
do(i) {
this.http
.getDataFromServer(
"api/example?id=" +i
)
.subscribe((response) => {
console.log(i);
});
}
Run Code Online (Sandbox Code Playgroud)
我想等待得到回复,回复后转到下一步i
但不能工作 console.log 打印:
2
3
5
1
4
7
8
9
6
Run Code Online (Sandbox Code Playgroud)
请注意,从 api 接收响应的时间不固定。
有什么帮助吗?
我的 Angular 项目是版本 13,我将其逐步迁移到 Angular 16。现在我想让它完全独立,然后将其迁移到版本 17。
是否有任何我可以使用的实用程序或者我必须手动执行?
typescript angular angular-migration angular-standalone-components
angular ×4
typescript ×3
angular-cli ×1
angular-standalone-components ×1
async-await ×1
asynchronous ×1
css ×1
javascript ×1
sass ×1