Skip to content

Instantly share code, notes, and snippets.

@n1lesh
Created December 22, 2017 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n1lesh/578d12214a3a4ffd268ff348474c5282 to your computer and use it in GitHub Desktop.
Save n1lesh/578d12214a3a4ffd268ff348474c5282 to your computer and use it in GitHub Desktop.
Adding ld+json structured data to AngularJs app Raw - Controller Code
app.controller('homeController', ['$scope', function ($scope) {
$scope.$root.ld = {
"@context": "http://schema.org/",
"@type": "WebSite",
"name": 'My Wonderful Site',
"image": "https://mywonderfulsite.com/logo.png",
"description": 'We have the best content in the world',
"url": 'https://mywonderfulsite.com/'
}
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment