Text inside tag outside of output tag in Angular.js
问题 I have a link tag in HTML: <link url="http://google.com">google</link> and code that transform it to <a> tag: app.directive('link', function() { return { restrict: 'E', transclude: true, replace: true, scope: { url: '@' }, template: '<a href="{{url}}" ng-transclude></a>' } }); But using this text Google is outside and URL is not removed (it copy if from link to a tag). If I use an attribute it works fine <div link url="http://google.com">google</div> What's wrong? Here is jsFiddle. 回答1: I