Look at example:
$scope.fields = [{
name: \'Email\',
dir : \"abc\"
}, {
name: \'List\',
dir : \"ffffd\"
}];
app.directive(\'abc\', function ()
You could put this:
also in a directive. You could construct this HTML string in JavaScript and attach it to the DOM. And you would also need to compile the resulting element using the $compile service, so that the dynamic directives will be compiled.
Some dummy sample code (not tested, but should look something like this):
app.directive('dynamicInput', function($compile){
return {
link: function(scope, element){
var htmlString = '';
element.replaceWith(htmlString);
$compile(angular.element(element))(scope);
}
}
});
More info here.