Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 5d30901

Browse files
committed
Change transinject for uisTranscludeAppend from #151
1 parent b7c568a commit 5d30901

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

src/bootstrap/match-multiple.tpl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
ng-click="$select.activeMatchIndex = $index;"
99
ng-class="{'btn-primary':$select.activeMatchIndex === $index}">
1010
<span class="close" ng-hide="$select.disabled" ng-click="$select.removeChoice($index)">&nbsp;&times;</span>
11-
<span transinject></span>
11+
<span uis-transclude-append></span>
1212
</button>
1313
</span>
1414
</span>

src/select.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@
843843
}
844844
};
845845
}])
846+
// Recreates old behavior of ng-transclude. Used internally.
846847
.directive('uisTranscludeAppend', function () {
847848
return {
848849
link: function (scope, element, attrs, ctrl, transclude) {
@@ -891,13 +892,5 @@
891892
return function(matchItem, query) {
892893
return query && matchItem ? matchItem.replace(new RegExp(escapeRegexp(query), 'gi'), '<span class="ui-select-highlight">$&</span>') : matchItem;
893894
};
894-
})
895-
// Re-creates the old behavior of ng-transclude. Used internally.
896-
.directive('transinject', function() {
897-
return function(scope, element, attrs, ctrl, transcludeFn) {
898-
transcludeFn(scope, function(clone) {
899-
element.append(clone);
900-
});
901-
};
902895
});
903896
}());

src/select2/match-multiple.tpl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<span class="ui-select-match">
77
<li class="select2-search-choice" ng-repeat="$item in $select.selected"
88
ng-class="{'select2-search-choice-focus':$select.activeMatchIndex === $index}">
9-
<span transinject></span>
9+
<span uis-transclude-append></span>
1010
<a href="#" class="select2-search-choice-close" ng-click="$select.removeChoice($index)" tabindex="-1"></a>
1111
</li>
1212
</span>

0 commit comments

Comments
 (0)