-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Issue with using ng-transclude #5161
Description
I am in the process of migrating from
AngularJS 1.3.16 to 1.4.8
AnbularUI-Bootstrap 0.13.0 to 0.14.3
and I have come across the following issue:
I have a directive that dynamically creates tabs, transcluding html for each tab.
The application usage:
<dynamic-tabs >
<grid ptp-id="{{tab.id}}"></grid>
</dynamic-tabs>
the tab variable above is created via an ng-repeat expression within the directive
The directive dynamic-tab template is as follows:
<div class="dynamic-tabs">
<tabset>
<tab ng-repeat="tab in vm.tabs track by $index"
active="tab.isCurrentTab"
select="selected(tab)">
<tab-heading>
<span>{{ tab.name }}</span>
</tab-heading>
<div ng-transclude ng-if="tab.isCurrentTab"></div>
</tab>
</tabset>
</div>
Prior to 0.13.2 the above works.
From 0.13.2 the tab variable within the application usage is no longer available and is undefined.
I believe the commit 2004757 where the use of the compile function was replaced with a linking function is the cause.
I have reverted that single change and the issue is resolved in my code and the unit tests in angular-ui/bootstrap did not break.
I took a look at creating a unit test to cover this particular use case of transclusion but it did not feel correct to add it in the existing test code, since it more integration and requires a directive created using tabs etc. We can take that off line.
I issued a PR #5160 which reverts that change, but while fine tuning this text realized the revert is not the answer due to it actually closing #4061 (which I hadn't noticed)
So the question becomes is this a bug or the new expected behaviour and if so any suggestions on how to achieve this behaviour.
Regards
Aidan