我想在 aws 上部署我的 angular 通用应用程序。
根据我的理解,我只能在弹性 beanstalk 上部署我的应用程序,因为它需要一个 Web 服务器才能运行。(这意味着没有 S3 部署)。
当我部署我的应用程序时,出现以下错误:
错误:在 ServerResponse.render (/ var/app/current/server.js:131120:7) at /var/app/current/server.js:138:9 at Layer.handle [as handle_request] (/var/app/current/server.js:124007 :5) 在下一个 (/var/app/current/server.js:123755:13) 在 Route.dispatch (/var/app/current/server.js:123730:3) 在 Layer.handle [as handle_request] ( /var/app/current/server.js:124007:5) at /var/app/current/server.js:123230:22 at param (/var/app/current/server.js:123303:14) at param (/var/app/current/server.js:123314:14)
这是我到目前为止所做的:
npm run build:ssr还有我的server.ts文件:
import 'zone.js/dist/zone-node';
import 'reflect-metadata';
import { enableProdMode } from '@angular/core';
// Express Engine
import { ngExpressEngine } …Run Code Online (Sandbox Code Playgroud) 我按照此处的Angular文档将服务器端渲染添加到Angular项目中。
我发现的命令来运行静态预渲染 npm run build:prerender和npm run serve:prerender使用CLI命令后不在这里:
ng add @nguniversal/express-engine --clientProject [angular.projet]
我想知道Universal是否仍支持静态预渲染?生成的代码全部与动态SSR有关。
这很奇怪,因为我在Universal-starter上找到了这些命令。
有人知道吗?另外,如何在我的角度项目中添加静态预渲染?
要复制,请在终端中运行:
ng new foo 开始一个新项目ng add @nguniversal/express-engine --clientProject foo 增加通用性感谢帮助。
在我的ThreadService类中,我有一个函数getThreads(),它向我返回Observable<Thread[]>所有线程。
现在,我想拥有另一个版本的函数,其线程由选定的主题过滤:function getSelectedThemeThreads(theme: Theme)。
我尝试了与运算符map,filter但是出现以下错误消息Property 'theme' does not exist on type 'Thread[]。
在我正在处理的代码下面:
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { catchError } from 'rxjs/operators';
import { Thread } from '../models/thread.model';
import { Theme } from '../models/theme.model';
@Injectable({
providedIn: 'root'
})
export class ThreadService {
private threadsUrl = 'api/threads';
constructor(private http: HttpClient) { }
getThreads(): Observable<Thread[]> …Run Code Online (Sandbox Code Playgroud) 我在角度项目中使用CLI工具链配置了Amplify Authentication模块.
现在,我尝试在Amazon Cognito控制台中更改我的用户池的属性设置,如下面的文档中所述:

不幸的是,我在控制台中看到所有字段都被禁用了.
它是否被禁用,因为我在自动化设置中遗漏了某些内容,或者因为现在无法使用CLI,我需要提供手动设置?
谢谢你的回答,
考虑以下文件:
一份communications文件
{
"_id" : ObjectId("5c069a6acbd69e0f61983850"),
"type" : "request",
"title" : "test 1",
"messages" : [
{
"authorId" : "7b0dcd22-c3bb-426f-8235-671b82acee98",
"body" : "test 1",
"createdAt" : ISODate("2018-12-04T15:16:58.342Z")
}
],
"receivers" : [
"e75f3849-09bb-46a4-a05d-885b6d31ccc3"
]
}
Run Code Online (Sandbox Code Playgroud)
一份users文件
{
"_id" : "7b0dcd22-c3bb-426f-8235-671b82acee98",
"userInfo" : {
"avatarKey" : "7b0dcd22-c3bb-426f-8235-671b82acee98/avatars/Dandelion.png",
"familyName" : "Doe",
"givenName" : "John"
}
}
Run Code Online (Sandbox Code Playgroud)
在蒙戈外壳,我尝试检索communications与messages.authorId“居住”与userInfo我的领域user文档。
我试图用这样的方法来做到这$lookup一点:
db.communications.aggregate([
{
$lookup:
{
from: "users",
localField: "messages.authorId", …Run Code Online (Sandbox Code Playgroud) 我创建了一个名为commonmod.component.ts的组件,该组件包含在其他两个模块(abc和def)中。
abc.module.ts
import { commonmod } from '../commonmod/commonmod.component';
@NgModule({
declarations: [
commonmod
]
})
Run Code Online (Sandbox Code Playgroud)
def.module.ts
import { commonmod } from '../commonmod/commonmod.component';
@NgModule({
declarations: [
commonmod
]
})
Run Code Online (Sandbox Code Playgroud)
当我将abc模块中的一页重定向到def模块中的另一页时,它使我跟随以下错误。
错误错误:未捕获(承诺):错误:类型commonmod是2个模块的声明的一部分:abcand def!请考虑将commonmod移至导入abc和def的更高模块。您还可以创建一个新的NgModule,以导出并包括commonmod,然后在abcand def中导入该NgModule。错误:类型commonmod是2个模块的声明的一部分:abc和def!请考虑将commonmod移至导入abcand def的更高模块。您还可以创建一个新的NgModule,将其导出并包括commonmod,然后在abc和def中导入该NgModule。