テンプレートのコンテンツとして文字列変数を設定することは可能ですか? スコープに応じて 2 つの異なるテンプレートを選択したいと考えています。このようなもの:
define(['app'], function(app){
app.directive('logstorelist', function(){
var temp="";
return{
scope: true,
restrict: 'A',
link: function(s, e, a){
if(a=="a")
temp = "<a>tempA</a>";
else
temp = "<div>temp</div>";
},
replace: true,
template: temp
}
})
});
このようなことは可能ですか?