我正在开发 Angular 5 应用程序,但我陷入了困境。我想在 html 标签中动态添加特定于每个页面的微数据,例如
<html itemscope itemtype="http://schema.org/QAPage">
Run Code Online (Sandbox Code Playgroud)
有什么办法可以做到这一点吗?如果有的话请告诉我。
如何在php中解析这个数组?
$graphNode = $response->getGraphEdge();
Facebook\GraphNodes\GraphNode Object
(
[items:protected] => Array
(
[name] => Haridwar
[id] => 108165019208093
)
)
Facebook\GraphNodes\GraphNode Object
(
[items:protected] => Array
(
[name] => Haridwar - ??????? ????????
[id] => 1421343878181284
)
)
Facebook\GraphNodes\GraphNode Object
(
[items:protected] => Array
(
[name] => Haridwar , Rishikesh
[id] => 422468281161935
)
)
Facebook\GraphNodes\GraphNode Object
(
[items:protected] => Array
(
[name] => Harkipodi, Haridwar
[id] => 1729854440364388
)
)
Facebook\GraphNodes\GraphNode Object
(
[items:protected] => Array
(
[name] => Haridwar, …Run Code Online (Sandbox Code Playgroud) 最近我将角度5升级到角度6,因此我升级了服务代码如下:
register(postBody: any): Observable<any> {
return this.http
.post(this.remoteUrl + "auth/register", postBody)
.pipe(
catchError(this.handleError("register", []))
);
}
this.authService.register(this.formObj.value).subscribe(
response => {
}
)
Run Code Online (Sandbox Code Playgroud)
现在,当我从API获得400错误时.我能够在错误处理程序中捕获此错误但仍然订阅执行,为什么?订阅应该只在获得没有错误的响应时调用.
我是新手,但在角度5中它并没有发生.所以任何人都可以纠正我的错误吗?