See also:
- How to load JavaScript or stylesheet conditionally depends on admin config settings
- How to add a stylesheet to a page after the layout has already been built
- How to insert some JavaScript to a *.phtml template in the proper way (x-magento-init)
- How to pass parameters from *.phtml to a JavaScript component using x-magento-init