In this plunk I have a directive with a table. I'm trying to add dynamically to the table one row with two cells. Still, the table is showing only one cell. What's wrong with this code?
Javascript
angular.module('app', []);
angular.module('app')
.directive('directive1', function() {
var directive = {};
directive.restrict = 'E';
directive.scope = true;
directive.template = '<table class="c" border="1"></table>';
directive.link = function(scope, element, attrs) {
var t = angular.element(".c");
var r1 = t.append("<tr></tr>");
var col1 = r1.append("<td></td>");
col1.text("1111");
var col2 = r1.append("<td></td>");
col2.text("2222");
};
return directive;
});