I would like to know why the module material.svgAssetsCache
is injected in code used on the Angular material website.
angular.module('MyApp',['ngMaterial', 'ngMessages', 'material.svgAssetsCache'])
Here is an example of code on the AM website: https://material.angularjs.org/latest/demo/button
I know the application uses svgs for icons, but it still works without injecting the material.svgAssetsCache
library.
According to a comment in the Angular Material repository, that file should only be used in a CDN Server
or an Edge Server
:
/**
* This 'svg-assets-cache.js' file should be loaded to a CDN or edge-server (currently S3).
* The CDN url (for this file) is then used in `doc/app/js/codepen.js#L59` to identify an
* external JS file that CodePen should load for 'launched' demos.
*/
So, at the end you are right. You don't need to include it if you are self hosting the material icons. It's only for CodePen.
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