Angular.js に新しい要素を作成したい
<link url="http://google.com">google</link>
それはタグに変換され<a>
ます。どうすればこれを行うことができますか?
これまでのコード:
var app = angular.module('app', []);
app.directive('link', function() {
return {
restrict: 'E',
transclude: true,
replace: true,
scope: false,
template: '<a href="" ng-transclude></a>';
}
});
しかし、リンクの後にGoogleをレンダリングし、URLを取得する方法がわかりません.