当没有与我的数组匹配的路由时,我想在当前页面上设置标题404。
从其他方面来说,我认为这将是SEO中的问题,未知页面也将添加到搜索引擎中。
我在下面有一个抽象类:
import { Inject } from '@angular/core';
import { TestService } from '../test-service';
export abstract class DummyAbstract {
constructor (
private testService: TestService
) {
}
abstract thisisimp();
}
Run Code Online (Sandbox Code Playgroud)
我有一个孩子上以下课:
import { Injectable } from '@angular/core';
import { DummyAbstract } from './dummy-abstract';
@Injectable({
providedIn: 'root'
})
export class ThisChild extends DummyAbstract {
thisisimp() {
return 'text';
}
}
Run Code Online (Sandbox Code Playgroud)
当我尝试在其他服务中加载子类时出现问题
import { Injectable } from '@angular/core';
import { ThisChild } from './this-child';
@Injectable({
providedIn: 'root'
})
export class SomeOtherService {
constructor(private …Run Code Online (Sandbox Code Playgroud) 我从 URL 读取数据并得到以下 json 格式的响应:
'"{\r\n \"data\": \"\",\r\n \"error\": \".\",\r\n \"success\": \"\"\r\n}"'
Run Code Online (Sandbox Code Playgroud)
自从使用 json_decode($aboveStr, true); 之后 它输出以下字符串格式:
{"data": "","error": "","success": ""}
Run Code Online (Sandbox Code Playgroud)
我想要数组中的输出。