Reputation: 21
var template ='<div id="'+'inst'+id+'" ng-click="setCurrentId('+id+')" >'+
'< {{$scope.somevariable}} data-role="listview" >'+
'<li><a href="acura.html">Acura</a></li>'+
'<li><a href="audi.html">Audi</a></li>'+
'<li><a href="bmw.html">BMW</a></li>'+
'</{{$scope.somevariable}}>'+
'</div>';
in the above code i want something like $scope.somevariable to be replaced by ul or ol but unfortunately this doesnt work
can someone tell me how to create dynamic tags using angular js?
Note: attributes like data-role maybe dynamic (i.e may or maynot exist).. so as such i cannot use ng-switch
Upvotes: 2
Views: 888