Created
July 9, 2014 15:04
-
-
Save Ficik/d6599ed032025f4a3ee8 to your computer and use it in GitHub Desktop.
Simple directive creating scope
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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