Angular10 Add scripttag to index for google jobs posting

  angular, script

If you want to use google jobs posting you need to add a scripttag to the HEAD.
See example below I have made the JSON a bit smaller.

<html>
  <head>
    <title>Software Engineer</title>
    <script type="application/ld+json">
    {
      "@context" : "https://schema.org/",
      "@type" : "JobPosting",
      "title" : "Software Engineer",
      "description" : "<p>Google aspires to be an organization that reflects the globally diverse audience that our products and technology serve. We believe that in addition to hiring the best talent, a diversity of perspectives, ideas and cultures leads to the creation of better products and services.</p>",
      "identifier": {
        "@type": "PropertyValue",
        "name": "Google",
        "value": "1234567"
      },
      "datePosted" : "2017-01-18",
      "validThrough" : "2017-03-18T00:00",
      "employmentType" : "CONTRACTOR",
      "hiringOrganization" : {
        "@type" : "Organization",
        "name" : "Google",
        "sameAs" : "http://www.google.com",
        "logo" : "http://www.example.com/images/logo.png"
      },
      
    }
    </script>
  </head>
  <body>
  </body>
</html>

I tried to achieve this bij creating an script element in a specific component.
The thing is that this script does not appear in the pagesource.
Is there a way to achieve this?

Thx a lot

Source: Angular Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.