[英]Angular SSR configuration on Azure app service
I work with angular v10 SSR with .net core 3.1.我使用 angular v10 SSR 和 .net 核心 3.1。 Downloaded the sample code from here: https://angular.io/guide/universal and deployed to Azure Appservice.
从这里下载示例代码: https://angular.io/guide/universal并部署到 Azure Appservice。 On azure Appservice Node.js run and start server/main.js.
在 azure Appservice Node.js 上运行并启动 server/main.js。
My questions:我的问题:
<app-root>
tag contains the static files which works correctly.<app-root>
标签包含 static 文件,可以正常工作。 After deploy to Azure Appservice its contains only <app-root></app-root>
empty tag.<app-root></app-root>
空标签。 Is it works correctly?<app-root></app-root>
on appservice?<app-root></app-root>
吗?Thanks cyr_x Your answer helped lot.谢谢cyr_x你的回答很有帮助。
Remove the NgModule
decorator from your imports
section.从
imports
部分移除NgModule
装饰器。 Also remove the AppComponent
from the imports
of your module.同时从模块的
imports
中删除AppComponent
。
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
MaterialModule
],
bootstrap: [AppComponent]
})
export class AppModule {
}
The imports
attribute should only contain classes which are decorated with NgModule
. imports
属性应该只包含用NgModule
装饰的类。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.