Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

material.svgAssetsCache injected in module of application - angular js

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.

like image 644
yovan juggoo Avatar asked Jul 26 '16 06:07

yovan juggoo


Video Answer


1 Answers

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.

like image 121
Luis Lavieri Avatar answered Oct 12 '22 14:10

Luis Lavieri