diff --git a/example/builtins/src/ExampleDirective.js b/example/builtins/src/ExampleDirective.js
index 5bae65ebbe..2f2a454be7 100644
--- a/example/builtins/src/ExampleDirective.js
+++ b/example/builtins/src/ExampleDirective.js
@@ -8,9 +8,11 @@ define(
function () {
"use strict";
- var HAS_EXTENSIONS = "A directive loaded these example extensions.",
+ var HAS_EXTENSIONS = "A directive loaded these message from " +
+ "example extensions.",
NO_EXTENSIONS = "A directive tried to load example extensions," +
- " but found none.";
+ " but found none.",
+ MESSAGE = "I heard this from my partial constructor.";
/**
*
@@ -22,8 +24,14 @@ define(
HAS_EXTENSIONS : NO_EXTENSIONS;
template += "
"
- examples.forEach(function (e) {
- template += "- " + e.text + "
";
+ examples.forEach(function (E) {
+ template += "- ";
+ if (typeof E === 'function') {
+ template += (new E(MESSAGE)).getText();
+ } else {
+ template += E.text;
+ }
+ template += "
";
});
template += "
";
diff --git a/example/extensions/bundle.json b/example/extensions/bundle.json
index 3093a4ee8b..aca5319321 100644
--- a/example/extensions/bundle.json
+++ b/example/extensions/bundle.json
@@ -6,6 +6,10 @@
"examples": [
{
"text": "I came from example/extensions"
+ },
+ {
+ "implementation": "SomeExample.js",
+ "depends": [ "exampleService" ]
}
]
}
diff --git a/example/extensions/src/SomeExample.js b/example/extensions/src/SomeExample.js
new file mode 100644
index 0000000000..ceab8e2c6a
--- /dev/null
+++ b/example/extensions/src/SomeExample.js
@@ -0,0 +1,31 @@
+/*global define,Promise*/
+
+/**
+ * Module defining SomeExample. Created by vwoeltje on 11/5/14.
+ */
+define(
+ [],
+ function () {
+ "use strict";
+
+ /**
+ *
+ * @constructor
+ */
+ function SomeExample(exampleService, message) {
+ return {
+ getText: function () {
+ return [
+ '"',
+ exampleService.getMessage(),
+ '" and "',
+ message,
+ '"'
+ ].join("");
+ }
+ };
+ }
+
+ return SomeExample;
+ }
+);
\ No newline at end of file