2017-01-30 21:46:24 +00:00
|
|
|
define([
|
|
|
|
'text!../res/templates/mct-example.html'
|
|
|
|
], function (
|
|
|
|
MCTExampleTemplate
|
|
|
|
) {
|
|
|
|
|
|
|
|
function MCTExample() {
|
|
|
|
function link($scope, $element, $attrs, controller, $transclude) {
|
2017-02-01 01:21:22 +00:00
|
|
|
var codeEl = $element.find('pre');
|
2017-01-30 21:46:24 +00:00
|
|
|
var exampleEl = $element.find('div');
|
|
|
|
|
|
|
|
$transclude(function (clone) {
|
|
|
|
exampleEl.append(clone);
|
2017-01-30 23:24:25 +00:00
|
|
|
codeEl.text(exampleEl.html()
|
|
|
|
.replace(/ class="ng-scope"/g, "")
|
|
|
|
.replace(/ ng-scope"/g, '"'));
|
2017-01-30 21:46:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
restrict: "E",
|
|
|
|
template: MCTExampleTemplate,
|
|
|
|
transclude: true,
|
|
|
|
link: link,
|
|
|
|
replace: true
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return MCTExample;
|
|
|
|
});
|