JavaScript Ng-transclude not working with table element

I am trying to build a directive for a table to display data.

The table has a header and a body.

Ideally I would like to have the following directives:

<div my-table></div>
<div my-table-header></div>
<div my-table-body></div>

So that I can use them with ng-transclude

<div my-table>
    <div my-table-header></div>
    <div my-table-body></div>
</div>

However, this does not work with the following template for my-table:

<table class="table" ng-transclude></table>

When the page renders, I end up with the following:

<div my-table="" class="ng-scope">



            1
            2




            a
            b



        </div>

I have seen some mention of ng-transclude not working well with tables. For example, if you put

<table><div ng-transclude></div></table>

the browser moves the ng-transclude div outside of the table

I was wondering if anyone had any experience solving this problem, as it seems like a fairly reasonable thing to want to do.

Cheers!

Answer:1

I have no idea where to start with this and came here to learn how to do it. I have the following radio lists and textarea(#mcsound): <input type="radio" name="skeleton" id="1mcskel1" value="Top" ...

I have no idea where to start with this and came here to learn how to do it. I have the following radio lists and textarea(#mcsound): <input type="radio" name="skeleton" id="1mcskel1" value="Top" ...

I'm trying to get the results of an API call and save it to $scope.segments, so that later I can sort the array using $scope.segments.sort() However, since $scope.segments = SegmentsService....

I'm trying to get the results of an API call and save it to $scope.segments, so that later I can sort the array using $scope.segments.sort() However, since $scope.segments = SegmentsService....

I would like to handle a click event on a node with dracula JS, the node is added using this code : g.addNode(capability, {render:render}); Any suggestion please ?

I would like to handle a click event on a node with dracula JS, the node is added using this code : g.addNode(capability, {render:render}); Any suggestion please ?

What would be the equivalent of this without using a for loop? Unsure what array method to use function func(x){ var y = []; for(i=0;i<x.length;i++){ y.push(x[i]); y.push(...

What would be the equivalent of this without using a for loop? Unsure what array method to use function func(x){ var y = []; for(i=0;i<x.length;i++){ y.push(x[i]); y.push(...