I have a number of directives in my angular module, these are named: MyDirective1, MyDirective2, ... , MyDirectiveN
I maintain a list of directive names as well: MyDirectiveList: ['MyDirective1', 'MyDirective2', ... , 'MyDirectiveN']
In HTML, I would like to display one of the directives based a variable (selectedDirective) which holds the directive name (either with ng-if or ng-show).
<div ng-repeat="directiveName in MyDirectiveList">
<div ng-if="selectedDirective == directiveName">
...directive shall go in here...
</div>
</div>
I could insert into the element using $injector and $compile in the controller but I wonder if there is more angular way of doing this directly in the html with angular directives.