Is is possible to somehow use ngTransclude
for an attribute value, instead of replacing inner HTML content? For example this simple directive
var testapp = angular.module('testapp', [])
testapp.directive('tag', function() {
return {
template: '<h1><a href="{{transcludeHere}}" ng-transclude></a></h1>',
restrict: 'E',
transclude: true
}
});
and use it as
<tag>foo</tag>
I want it to translate into
<h1><a href="foo">foo</a></h1>
Is there any way of doing that, or do I have to use an attribute instead of transcluding?
Here's a fiddle with the example
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…