app.directive('compComments', function ($compile) {
return {
restrict: 'AE',
replace: true,
link: function (scope, element, attrs) {
var compCommentWidget = $('<div>').addClass('compCommentWidget');
var headerBlock = $('<div>').appendTo(compCommentWidget).addClass('compCommentHeader');
$('<div>').appendTo(headerBlock).text(attrs.username).addClass('compCommentUserName');
$('<a>').appendTo(headerBlock).text('[Delete]').attr('href', attrs.jscommand).addClass('compCommentDelete');
$('<div>').appendTo(headerBlock).text(attrs.timestamp).addClass('compCommentTimeStamp');
$('<div>').appendTo(compCommentWidget).addClass('compComment').dxTextArea({ readOnly: true, value: attrs.comment }).dxTextArea('instance');
compCommentWidget = $compile(compCommentWidget)(scope);
element.after(compCommentWidget);
}
};
});