小编syn*_*ryd的帖子

Angular 11 - subscribe is deprecated: Use an observer instead of a complete callback

I have an Angular application in which errors are beginning to appear in the subscribe that they are deprecated.

This is my subscribe:

this.route.params.subscribe(params => {
      this.clienteId = +params['clienteId'];
      this.isNew = !this.clienteId;
      if (!this.isNew) {
        this.clienteService.get(this.clienteId).subscribe(c => {
          this.cliente = c;
          this.formNuevo.patchValue(this.cliente);
        });
      }
    });
Run Code Online (Sandbox Code Playgroud)

This is the client-service.ts (get):

public get(idClient: number): Observable<Client> {
      return this.http.get<Client>(`${PREFIX}/${idClient}`);
    }
Run Code Online (Sandbox Code Playgroud)

This is the error of the new subscribe:

在此输入图像描述

-> 'clienteId' : object access via string literals is disallowed (no-string-literal)tslint(1)

-> …

rxjs angular

5
推荐指数
1
解决办法
2万
查看次数

Spring Boot 中的日志未显示在终端中

我有一个项目,Spring Boot我在其中添加带有@Slf4j注释的日志,但在启动项目时无法让它们显示在终端中。

这是日志:log.info("totalVacations: " + totalVacations);

当我在终端中运行命令mvn spring-boot:run 时,我看不到该消息。

slf4j spring-boot

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

angular ×1

rxjs ×1

slf4j ×1

spring-boot ×1