openmct/example/styleguide/src/MCTExample.js
Charles Hacskaylo 7543faa577 [Frontend] WIP Style Guide
Fixes #1233
Adds to text inputs content;
Mods to MCTExample to allow a padded
wrapper around <pre> element;
Fixed snow theme css file reference;
2017-01-31 17:21:22 -08:00

31 lines
770 B
JavaScript

define([
'text!../res/templates/mct-example.html'
], function (
MCTExampleTemplate
) {
function MCTExample() {
function link($scope, $element, $attrs, controller, $transclude) {
var codeEl = $element.find('pre');
var exampleEl = $element.find('div');
$transclude(function (clone) {
exampleEl.append(clone);
codeEl.text(exampleEl.html()
.replace(/ class="ng-scope"/g, "")
.replace(/ ng-scope"/g, '"'));
});
}
return {
restrict: "E",
template: MCTExampleTemplate,
transclude: true,
link: link,
replace: true
};
}
return MCTExample;
});