diff --git a/docs/processors/demos.js b/docs/processors/demos.js
index 0bccebbae9..dc342d61fa 100644
--- a/docs/processors/demos.js
+++ b/docs/processors/demos.js
@@ -135,6 +135,17 @@ module.exports = {
)
});
+ //Write the demo list to current version (eg at /nightly);
+ docs.push({
+ docType: 'demo',
+ template: 'demo_list.template.js',
+ outputPath: path.join(
+ config.get('demos.outputFolder'),
+ config.get('versionData.current.folder'),
+ 'demo-list.js'
+ )
+ });
+
extraData.demos = allDemos;
}
};
diff --git a/docs/templates/demo_index.template.html b/docs/templates/demo_index.template.html
index cd2d278b83..456b698854 100644
--- a/docs/templates/demo_index.template.html
+++ b/docs/templates/demo_index.template.html
@@ -8,6 +8,7 @@
<@ endif @>
+
<@ if doc.demoData and doc.demoData.javascript @>
<@ endif @>
diff --git a/docs/templates/demo_list.template.js b/docs/templates/demo_list.template.js
new file mode 100644
index 0000000000..ea0e899953
--- /dev/null
+++ b/docs/templates/demo_list.template.js
@@ -0,0 +1 @@
+var DEMOS = <$ demos | json $>;
diff --git a/docs/templates/demo_script.template.js b/docs/templates/demo_script.template.js
index eb729f52da..99d360c098 100644
--- a/docs/templates/demo_script.template.js
+++ b/docs/templates/demo_script.template.js
@@ -1,4 +1,3 @@
-var DEMOS = <$ demos | json $>;
var DEMO;
<@ if doc.demoData @>
DEMO = <$ doc.demoData | json $>;
@@ -65,7 +64,7 @@ angular.module(<@ if doc.demoData @>'<$ doc.demoData.module $>'
})
.filter('humanize', function() {
return function(input) {
- return input.charAt(0).toUpperCase() +
+ return input.charAt(0).toUpperCase() +
input.substring(1).replace(/[A-Z]/g, function(match, i) {
return ' ' + match.toUpperCase();
});