nestjs

Angular/Rxjs pipe async does not work with ssr?

时光毁灭记忆、已成空白 提交于 2020-12-30 17:29:14
问题 I have an issue with the async pipe running on SSR. there are no errors, only an infinite loop (it seems that the server is waiting for the observable to be resolved). I am using: @nestjs/ng-universal Angular 9 Firebase Rxjs A simple case like this works: <p>{{ observable | async }}</p> But using structural directives do not work: ngIf <p *ngIf="(observable$ | async) > 5">{{ observable$ | async }}</p> Ngfor <p *ngFor="let item of items | async">{{ item }}</p> Using async is a good practice

Angular/Rxjs pipe async does not work with ssr?

妖精的绣舞 提交于 2020-12-30 17:25:32
问题 I have an issue with the async pipe running on SSR. there are no errors, only an infinite loop (it seems that the server is waiting for the observable to be resolved). I am using: @nestjs/ng-universal Angular 9 Firebase Rxjs A simple case like this works: <p>{{ observable | async }}</p> But using structural directives do not work: ngIf <p *ngIf="(observable$ | async) > 5">{{ observable$ | async }}</p> Ngfor <p *ngFor="let item of items | async">{{ item }}</p> Using async is a good practice

Angular/Rxjs pipe async does not work with ssr?

此生再无相见时 提交于 2020-12-30 17:21:31
问题 I have an issue with the async pipe running on SSR. there are no errors, only an infinite loop (it seems that the server is waiting for the observable to be resolved). I am using: @nestjs/ng-universal Angular 9 Firebase Rxjs A simple case like this works: <p>{{ observable | async }}</p> But using structural directives do not work: ngIf <p *ngIf="(observable$ | async) > 5">{{ observable$ | async }}</p> Ngfor <p *ngFor="let item of items | async">{{ item }}</p> Using async is a good practice

Angular/Rxjs pipe async does not work with ssr?

北城以北 提交于 2020-12-30 17:20:42
问题 I have an issue with the async pipe running on SSR. there are no errors, only an infinite loop (it seems that the server is waiting for the observable to be resolved). I am using: @nestjs/ng-universal Angular 9 Firebase Rxjs A simple case like this works: <p>{{ observable | async }}</p> But using structural directives do not work: ngIf <p *ngIf="(observable$ | async) > 5">{{ observable$ | async }}</p> Ngfor <p *ngFor="let item of items | async">{{ item }}</p> Using async is a good practice

Angular/Rxjs pipe async does not work with ssr?

陌路散爱 提交于 2020-12-30 17:20:36
问题 I have an issue with the async pipe running on SSR. there are no errors, only an infinite loop (it seems that the server is waiting for the observable to be resolved). I am using: @nestjs/ng-universal Angular 9 Firebase Rxjs A simple case like this works: <p>{{ observable | async }}</p> But using structural directives do not work: ngIf <p *ngIf="(observable$ | async) > 5">{{ observable$ | async }}</p> Ngfor <p *ngFor="let item of items | async">{{ item }}</p> Using async is a good practice

Angular/Rxjs pipe async does not work with ssr?

核能气质少年 提交于 2020-12-30 17:19:47
问题 I have an issue with the async pipe running on SSR. there are no errors, only an infinite loop (it seems that the server is waiting for the observable to be resolved). I am using: @nestjs/ng-universal Angular 9 Firebase Rxjs A simple case like this works: <p>{{ observable | async }}</p> But using structural directives do not work: ngIf <p *ngIf="(observable$ | async) > 5">{{ observable$ | async }}</p> Ngfor <p *ngFor="let item of items | async">{{ item }}</p> Using async is a good practice

Angular/Rxjs pipe async does not work with ssr?

痞子三分冷 提交于 2020-12-30 17:18:21
问题 I have an issue with the async pipe running on SSR. there are no errors, only an infinite loop (it seems that the server is waiting for the observable to be resolved). I am using: @nestjs/ng-universal Angular 9 Firebase Rxjs A simple case like this works: <p>{{ observable | async }}</p> But using structural directives do not work: ngIf <p *ngIf="(observable$ | async) > 5">{{ observable$ | async }}</p> Ngfor <p *ngFor="let item of items | async">{{ item }}</p> Using async is a good practice

NestJS set HttpStatus in interceptor

大城市里の小女人 提交于 2020-12-29 07:24:46
问题 I'm using an interceptor to transform my response. I want to set the HttpStatus inside but the code I'm using now doesn't work. import { CallHandler, ExecutionContext, NestInterceptor, SetMetadata } from '@nestjs/common'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { classToPlain } from 'class-transformer'; import { ApiResponse } from '../models/apiResponse'; export class TransformInterceptor implements NestInterceptor { intercept( context: ExecutionContext

NestJs Swagger mixed types

可紊 提交于 2020-12-15 06:20:28
问题 I have a class that one of the properties can be string or array of strings, not sure how should I define it in swagger @ApiProperty({ description: `to email address`, type: ???, <- what should be here? required: true, }) to: string | Array<string>; update As @Youba suggeted answer I tried @ApiProperty({ description: `to email address(es)`, additionalProperties: { oneOf: [ { type: 'string' }, { type: 'Array<string>' }, ], }, required: true, }) and @ApiProperty({ description: `to email address

NestJs Swagger mixed types

本秂侑毒 提交于 2020-12-15 06:20:09
问题 I have a class that one of the properties can be string or array of strings, not sure how should I define it in swagger @ApiProperty({ description: `to email address`, type: ???, <- what should be here? required: true, }) to: string | Array<string>; update As @Youba suggeted answer I tried @ApiProperty({ description: `to email address(es)`, additionalProperties: { oneOf: [ { type: 'string' }, { type: 'Array<string>' }, ], }, required: true, }) and @ApiProperty({ description: `to email address