I am looking at this article on the Gallery API in Magento2. I am testing the code samples in my browser
var api = $('[data-gallery-role="gallery"]').data('gallery');
However, this returns
undefined... The first part does return an element
The later part is what seems to not be working as expected. Any idea what's wrong?