(function() { "use strict"; angular .module('shared') .directive('addfolder', function ($compile) { return { restrict: 'E', scope: { text: '@' }, template: '

{{text}}

', controller: function ($scope, $element) { $scope.add = function () { var el = $compile("")($scope); $element.parent().append(el); }; } }; }); }());