I would like to select a directive via a string.
The controller would look like this:
app.controller('demo_ctrl',function($scope){
$scope.directiveName = 'theName';
});
And in the HTML it should look something like this:
<div directive="directiveName"></div>
The controller I want to target is like this:
app.directive('theName', function() {
return {
restrict: 'E',
scope: {
value: '=',
},
template: '<div class="theClass">theName: {{value}}</div>',
controller: function($scope) {
console.log($scope.value);
}
}
});
I don't want to access the controller I want to select the directive. Is there a way of doing that?