angular directive doesnt render the template, after adding html dynamically in controller
<p>My problem is that my directive doesnt show the template. I added a html tag
with specific name in my controller to the dom via <em>"$sce.trustAsHtml(taskDirective)"</em> and <em>"$compile(taskDirective)($scope)"</em>. The controller-function inside
the directive is called. But the template is not showing up.</p>

<p>Im using the <em>$stateProvider</em>, which calls the <em>"TaskDetailCtrl"</em> with the certain HTML.</p>

<p>Anybody can help?</p>

<p>Thank you!+</p>

<p><strong>Controller:</strong></p>

<pre><code>app.controller("TaskDetailCtrl", function ($scope, $state, $stateParams, $sce, $compile) {

    cur_task = $stateParams.newTask;
    $scope.title = cur_task.title;
    var taskDirective = "&lt;" + cur_task.type + "taskdirective" + "&gt;&lt;/" + cur_task.type + "taskdirective" + "&gt;";
    $scope.showTask = $sce.trustAsHtml(taskDirective);
    $compile(taskDirective)($scope);

});
</code></pre>

<p><strong>Directive:</strong></p>

<pre><code>app.directive('clicktaskdirective', function () {
    return {
        restrict: 'E',
        template: '&lt;ion-content style="padding: 20px;" class="text-center"&gt;&lt;br&gt;&lt;br&gt;&lt;h1&gt;{{taskTitle}}&lt;/h1&gt;&lt;br&gt;&lt;br&gt;&lt;h4&gt;{{taskText}}&lt;/h4&gt;&lt;br&gt;&lt;br&gt;&lt;button class="button button-block button-stable" ng-click="start()"&gt;Stimmt!&lt;/button&gt;&lt;/ion-content&gt;', 
        controller: function ($scope, $state, $stateParams) {

            console.log("This is showing up!")
        }
    }
});
</code></pre>

<p><strong>HTML:</strong></p>

<pre><code>&lt;div ng-bind-html="showTask"&gt;&lt;/div&gt;
</code></pre>