I have seen something like the following document for forms:
$form['myelement']['#attached']['libraries_load'][] = array('myAwesomeLibrary');
However, this does not work in render arrays for pages or blocks. At least, not in Drupal 7. When attaching a JS library to a render array in a page or block, should I use the 'libraries_load' or 'library' key within the '#attached
' array? Neither seem to work.
Of course, it's possible to use the 'js' key along with libraries_get_path, but I'm not sure that's best practice for Drupal 7, and it doesn't really take advantage of the path in hook_libraries_info.