Skip to content

Instantly share code, notes, and snippets.

@acroix
Created February 21, 2014 10:02
Show Gist options
  • Save acroix/9131714 to your computer and use it in GitHub Desktop.
Save acroix/9131714 to your computer and use it in GitHub Desktop.
app.directive("debug", function ($compile) {
return {
terminal: true,
priority: 100000,
link: function (scope, element) {
var clone = element.clone();
element.attr("style", "color: red");
clone.removeAttr("debug");
var clonedElement = $compile(clone)(scope);
element.after(clonedElement);
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment