It is invalid for the HttpClient callback method to use the injection object method in Angular5?

1. Use angular HttpClient to request backend data to get the title. Setting the title through @ angular/platform/Title service has no effect. Please give me some advice and how to solve it?

2. The code snippet is as follows. Angular version: 5.2.0, there is no error message, that is, the method call does not meet expectations

import {Title} from "@angular/platform-browser";
import {HttpClient, HttpErrorResponse, HttpResponse} from "@angular/common/http";

constructor(private titleService: Title) {

 }


 
  ngOnInit() {
    let that = this;
    that.titleService.setTitle(""); //
    this.http.get<any>("/api/dingtalk/get-file-title/"+1,{ observe: "response"}).subscribe(
      (res: HttpResponse<any>) => {
        that.titleService.setTitle(""); //
        console.log("success!" ,that.titleService.getTitle())
      },
      (res: HttpErrorResponse) => console.log(res.error)
    );
  }

console.log ("stories!", that.titleService.getTitle ()) output:

:

Mar.05,2021

determine whether the request response is normal. The success callback


has found the cause. It is not an angular problem. This problem only occurs in dingtalk browsers. You need to use the dd.biz.navigation.setTitle method of dingtalk to set the title.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e67460-45c31.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e67460-45c31.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?