2014-11-04 16:02:36 -08:00
|
|
|
/*global define,Promise*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Module defining ExampleDirective. Created by vwoeltje on 11/4/14.
|
|
|
|
*/
|
|
|
|
define(
|
|
|
|
[],
|
|
|
|
function () {
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
*/
|
2014-11-05 12:40:53 -08:00
|
|
|
function ExampleDirective(examples) {
|
|
|
|
// Build up a template from example extensions
|
|
|
|
var template = examples.length > 0 ?
|
|
|
|
"A directive loaded these example extensions:<ul>" :
|
|
|
|
"This came from a directive.<ul>";
|
|
|
|
|
|
|
|
examples.forEach(function (e) {
|
|
|
|
template += "<li>" + e.text + "</li>";
|
|
|
|
});
|
|
|
|
template += "</ul>";
|
|
|
|
|
2014-11-04 16:02:36 -08:00
|
|
|
return {
|
2014-11-05 12:40:53 -08:00
|
|
|
template: template
|
2014-11-04 16:02:36 -08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return ExampleDirective;
|
|
|
|
}
|
|
|
|
);
|