angularjs - transcluded directive not working in angular js -
i have created directive in angular js transclude: true, , replace: true below
.directive('customelement', [function(){ return { restrict: 'e', template: '<table class="table table-striped table-bordered table-hover datalisting"><tbody ng-transclude></tbody></table></div>', replace: true, scope: { tablecaption : "@", colsname : "=", tabledata : "=" }, transclude: true, link: function(scope, elem, attrs) { console.log(scope.colsname); } }; }]);
and in html calling
<custom-element table-caption="port listing" cols-name="tablecolumns" table-data="portlist.emulationdetails"> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> </tr> </custom-element>
but when run code transcluded data (table rows) converted span , placed directive shown in image below
Comments
Post a Comment