Skip to content

Instantly share code, notes, and snippets.

@Ficik
Created July 9, 2014 15:04
Show Gist options
  • Select an option

  • Save Ficik/d6599ed032025f4a3ee8 to your computer and use it in GitHub Desktop.

Select an option

Save Ficik/d6599ed032025f4a3ee8 to your computer and use it in GitHub Desktop.
Simple directive creating scope
angular.module('scope',[])
.directive('scope', function(){
return {
scope: true,
transclude: true,
compile: function compile(tElement, tAttrs, transclude) {
return function(scope) {
transclude(scope.$parent, function(clone) {
tElement.html(clone.html());
});
}
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment