javascript - Text inside tag outside of output tag in Angular.js -


i have link tag in html:

<link url="http://google.com">google</link> 

and code transform <a> tag:

app.directive('link', function() {     return {         restrict: 'e',         transclude: true,         replace: true,         scope: {             url: '@'         },         template: '<a href="{{url}}" ng-transclude></a>'     } }); 

but using text google outside , url not removed (it copy if link tag). if use attribute works fine <div link url="http://google.com">google</div> what's wrong?

here is
jsfiddle.

i think know reason this, link if html tag (that head include stylesheet) single self closing tag, , seams how parser parse before angular executed.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -