Created
August 5, 2013 03:08
-
-
Save kruyvanna/6153196 to your computer and use it in GitHub Desktop.
This file contains 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
<my-widget> | |
<p>This is my paragraph text.</p> | |
</my-widget> | |
var app = angular.module("MyApp", []); | |
app.directive("myWidget", function() { | |
return { | |
restrict: "E", | |
transclude: true, | |
template: "<h3>Heading</h3>" | |
link: function(scope, element, attrs) { | |
//How do i get | |
//<p>This is my paragraph text.</p> | |
// without the <h3>Heading</h3> ? | |
// My question is to get the source element inside <my-widget> before it got appended by the template | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment