|
56 | 56 |
|
57 | 57 | var LINK_FONTS_ROBOTO = '<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic">';
|
58 | 58 |
|
59 |
| - var ASSET_CACHE_JS = 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/t-114/assets-cache.js'; |
| 59 | + var ASSET_CACHE_JS = 'http://ngmaterial.assets.s3.amazonaws.com/svg-assets-cache.js'; |
| 60 | + |
60 | 61 |
|
61 | 62 | return {
|
62 | 63 | translate: translate
|
|
75 | 76 | js: processJs(files.js),
|
76 | 77 | css: mergeFiles( files.css ).join(' '),
|
77 | 78 |
|
78 |
| - js_external: externalScripts.concat([CORE_JS, ASSET_CACHE_JS]).join(';'), |
| 79 | + js_external: externalScripts.concat([ASSET_CACHE_JS, CORE_JS]).join(';'), |
79 | 80 | css_external: [CORE_CSS, DOC_CSS].join(';')
|
80 | 81 | });
|
81 | 82 | }
|
|
184 | 185 | .replace(/&/g, "&");
|
185 | 186 | }
|
186 | 187 |
|
187 |
| - // Required to make codepen work. Demos define their own module when running on the |
188 |
| - // docs site. In order to ensure the codepen example can use the asset-cache, the |
| 188 | + // Required to make codePen work. Demos define their own module when running on the |
| 189 | + // docs site. In order to ensure the codepen example can use the svg-asset-cache.js, the |
189 | 190 | // module needs to match so that the $templateCache is populated with the necessary
|
190 | 191 | // assets.
|
| 192 | + |
191 | 193 | function replaceDemoModuleWithCodepenModule(file) {
|
192 | 194 | var matchAngularModule = /\.module\(('[^']*'|"[^"]*")\s*,(\s*\[([^\]]*)\]\s*\))/ig;
|
| 195 | + var modules = "['ngMaterial', 'ngMessages', 'material.svgAssetsCache']"; |
193 | 196 |
|
194 |
| - // Include 'ngMessages' since the 'assets-cache.js' has the same dependencies |
195 |
| - // angular.module('MyApp', ['ngMaterial', 'ngMessages']) |
196 | 197 | // See scripts.js for list of external Angular libraries used for the demos
|
197 | 198 |
|
198 |
| - return file.replace(matchAngularModule, ".module('MyApp',['ngMaterial', 'ngMessages'])"); |
| 199 | + return file.replace(matchAngularModule, ".module('MyApp',"+ modules + ")"); |
199 | 200 | }
|
200 | 201 | }
|
201 | 202 | })();
|
0 commit comments