Created
September 7, 2016 16:14
-
-
Save michaelnagy/d649f0d54b87453d10a18da02f0943f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client.getEntries() | |
.then(function (entries) { | |
// getting all the entries in a global var | |
content = entries; | |
entries.items.forEach(function (entry, index) { | |
if (entry.sys.contentType.sys.id == 'event') { | |
//separating the events type entries in a global var | |
events[index] = entry; | |
console.log(entry.fields.image.fields.file.url); // this shows me undefined on console.log | |
// if you inspect the entry object you will see a getter not resolved in image property, like in the screenshot: http://prnt.sc/cf9vmq | |
// After clicking the getter runs and the image gets filled, my question is, why this is not getting filled along with all the object? | |
// http://prntscr.com/cf9wtn | |
} | |
}); | |
}); | |
// Comment for the contentfull support team | |
// When I console.log the linked properties for the events array, I get undefined property |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there,
based on your data there is not field called image that's why you are getting undefined. However there is an array of images, called images and to access the url you can do