Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 86ec22a

Browse files
fix(demos): CodePen launches fixed
Fixes #6297.
1 parent 8d4e7c2 commit 86ec22a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/app/js/codepen.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,13 @@
158158
// module needs to match so that the $templateCache is populated with the necessary
159159
// assets.
160160
function replaceDemoModuleWithCodepenModule(file) {
161-
var matchAngularModule = /\.module\(('[^']*'|"[^"]*")\s*,(?:\s*\[([^\]]*)\])?/g;
162-
return file.replace(matchAngularModule, ".module('MyApp'");
161+
var matchAngularModule = /\.module\(('[^']*'|"[^"]*")\s*,(\s*\[([^\]]*)\]\s*\))/ig;
162+
163+
// Include 'ngMessages' since the 'assets-cache.js' has the same dependencies
164+
// angular.module('MyApp', ['ngMaterial', 'ngMessages'])
165+
// See scripts.js for list of external Angular libraries used for the demos
166+
167+
return file.replace(matchAngularModule, ".module('MyApp',['ngMaterial', 'ngMessages'])");
163168
}
164169
}
165170
})();

0 commit comments

Comments
 (0)