Angular App insights-从角度向浏览器添加页面标题
我实际上是想在浏览器中添加页面标题。因此,在每个页面中,我将页面标题设置如下Angular App insights-从角度向浏览器添加页面标题,angular,azure,azure-application-insights,appinsights,Angular,Azure,Azure Application Insights,Appinsights,我实际上是想在浏览器中添加页面标题。因此,在每个页面中,我将页面标题设置如下 private setDocumentTitle(reportData) { if (reportData && reportData.abc) { this.titleService.setTitle( 'test' + (reportData.abc.name ? ` - ${reportData.abc.name}`
private setDocumentTitle(reportData) {
if (reportData && reportData.abc) {
this.titleService.setTitle(
'test' +
(reportData.abc.name
? ` - ${reportData.abc.name}`
: '')
);
}
}
现在我想在浏览器中传递这个标题。我为AppInsight编写了以下代码。那么我该怎么做呢,这里我想传递页面标题而不是名称
trackPageViewPerformance(name?: string, url?: string) {
this.appInsights.trackPageViewPerformance({
name,
uri: url
});
}
不确定我是否完全理解了你的问题。SDK方法的
名称默认设置为documenttitle
。另外,如果您想传递其他内容,是什么阻止您像this.titleService.getTitle()
这样传递到您的trackPageViewPerformance
方法?