mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 01:25:16 +00:00
143db90a50
* getredash/redash#3017 Improve query page header * getredash/redash#3017 Resolve conflicts * getredash/redash#3017 CR1 (fix margins/paddings)
24 lines
620 B
JavaScript
24 lines
620 B
JavaScript
export default function init(ngModule) {
|
|
ngModule.directive('ngTranscludeReplace', $log => ({
|
|
terminal: true,
|
|
restrict: 'EA',
|
|
link: ($scope, $element, $attr, ctrl, transclude) => {
|
|
if (!transclude) {
|
|
$log.error(
|
|
'orphan',
|
|
'Illegal use of ngTranscludeReplace directive in the template! ' +
|
|
'No parent directive that requires a transclusion found.',
|
|
);
|
|
return;
|
|
}
|
|
transclude((clone) => {
|
|
if (clone.length) {
|
|
$element.replaceWith(clone);
|
|
} else {
|
|
$element.remove();
|
|
}
|
|
});
|
|
},
|
|
}));
|
|
}
|