i am working on a small project with angular js(ps:this is the first time i'm using it )and i'm blocked by this error and i don't understand why
angular.module("jsonerator", [])
.controller('theController', function ($scope) {
$scope.personld = {
"@context": {
"schema": "http://schema.org/"
},
"@graph": [
{
"@id": "person",
"@type": "schema:Person",
}
]
}
$scope.personld["@graph"][0]["schema:givenName"] = "";
$scope.personld["@graph"][1]["schema:familyName"] = "";
}
To fix the error you need to add another object to your @graph array and it should work. The ["@graph"][1] will then be defined. The issue was that you only had one item in your array.
"@graph": [
{ "@id": "person", "@type": "schema:Person" },
{}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With