angular - 我希望我的 Angular 6 应用程序与 Google Jobs 一起工作,但无法正确格式化

标签 angular webpack angular6

我希望我的 html 招聘信息显示在 google 招聘信息中。

这是架构:https://schema.org/JobPosting

但是 SPA 需要很长时间才能加载应用和显示作业,因此爬虫无法获取作业。

这是我的代码示例:

 <meta itemprop="address" content="{{ job.address.addressLine1 }} {{ job.address.postCode }}">
 <meta itemprop="addressLocality" content="{{ job.address.country }}">

 <p class="flex justify-between">
     <span itemprop="industry"><strong>{{ job.sector }}</strong></span>
     <span *ngIf="job.datePosted" itemprop="datePosted"><strong>{{ job.datePosted }}</strong></span>
 </p>

 <h3>
     <span itemprop="title">{{ job.name }}</span>
     <span itemprop="baseSalary">{{ job.pay.currency }}{{ job.pay.value }}</span>
 </h3>

 <p itemprop="description" [innerHtml]="job.description"></p>

如您所见,我添加了“itemprop”。

技术堆栈:Angular Version 6、Webpack、Angular Cli 6

当我从 google jobs 使用这个工具时,它不显示工作:https://search.google.com/structured-data/testing-tool/u/0/

最佳答案

我建议研究服务器端渲染来为您的 Angular 应用程序提供初始加载服务。这样谷歌将始终获得您页面的最终加载,因为它会在获得页面之前在服务器上呈现。

设置它的难度实际上取决于您的后端堆栈是什么,以及您的网络应用程序有多复杂。

关于angular - 我希望我的 Angular 6 应用程序与 Google Jobs 一起工作,但无法正确格式化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53377671/

相关文章:

angular - 无法绑定(bind)到 'ngModelOptions',因为它不是 'ion-input' 的已知属性

javascript - 同构 JS 应用程序中的环境变量 : Webpack find & replace?

javascript - 数据表显示 "No data available in table",即使表中有 Angular 数据

javascript - 如何将变量从一个函数传递到 Angular 6中同一组件.ts中的另一个函数

angular6 - 为什么 Angular ReactiveForms FormArray 会抛出错误 "TypeError: Cannot read property ' updateOn' of null”

angular - Angular 中不同模块的数组的类型是什么?

angular - 如何将 angular 2 组件转换为 webcomponents?

testing - Angular2 和测试 EventEmitter

angular - 如何在 Angular 应用程序中包含额外的 ES6 源代码

javascript - 包含 JavaScript 代码而不打包为模块