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

Commit 9c93830

Browse files
author
pkempenaers
committed
Change transclusion to named transclusion
1 parent f498725 commit 9c93830

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Version numbers correspond to `bower.json` version
22

3-
#2.0.0-beta.4
3+
# 2.0.0-beta.5 & 2.0.0-beta.6
4+
5+
## Features
6+
- Added support for transcluded custom toggle-dropdown element
7+
8+
# 2.0.0-beta.4
49

510
Small bugFix
611

src/app/component/angularjs-dropdown-multiselect.directive.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export default function dropdownMultiselectDirective() {
1212
translationTexts: '=',
1313
disabled: '=',
1414
},
15-
transclude: true,
15+
transclude: {
16+
toggleDropdown: '?toggleDropdown',
17+
},
1618
controller,
1719
templateUrl: 'app/component/angularjs-dropdown-multiselect.html',
1820
};

src/app/component/angularjs-dropdown-multiselect.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<div class="multiselect-parent btn-group dropdown-multiselect"
22
ng-class="{open: open}">
3-
<ng-transclude ng-click="toggleDropdown()">
3+
<div ng-transclude="toggleDropdown" ng-click="toggleDropdown()">
44
<button ng-disabled="disabled"
55
type="button"
66
class="dropdown-toggle"
77
ng-class="settings.buttonClasses"
88
>
99
{{getButtonText()}}&nbsp;<span class="caret"></span>
1010
</button>
11-
</ng-transclude>
11+
</div>
1212
<ul class="dropdown-menu dropdown-menu-form"
1313
ng-if="open"
1414
ng-style="{display: open ? 'block' : 'none', height : settings.scrollable ? settings.scrollableHeight : 'auto', overflow: 'auto' }">

src/app/main/main.template.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -981,15 +981,15 @@ <h3>Code</h3>
981981
<div uib-accordion-group heading="Custom trigger element using transclusion">
982982
<div class="row">
983983
<div class="col-xs-12">
984-
Example to show that you can replace the button with a custom element
984+
Example to show that you can replace the button with a custom element.
985985
</div>
986986
</div>
987987
<div class="row">
988988
<div class="col-xs-12 col-sm-6">
989989
<h3>Demo</h3>
990990
<div class="well">
991991
<div ng-dropdown-multiselect="" options="transclusionData" selected-model="transclusionModel" extra-settings="transclusionSettings">
992-
<span class="custom-trigger">My Custom trigger</span>
992+
<toggle-dropdown><span class="custom-trigger">My Custom trigger</span></toggle-dropdown>
993993
</div>
994994
</div>
995995
</div>
@@ -1004,7 +1004,7 @@ <h3>Code</h3>
10041004
<div hljs language="javascript">
10051005
// HTML
10061006
<div ng-dropdown-multiselect="" options="transclusionData" selected-model="transclusionModel" extra-settings="transclusionSettings">
1007-
<span class="custom-trigger">My Custom trigger</span>
1007+
<toggle-dropdown><span class="custom-trigger">My Custom trigger</span></toggle-dropdown>
10081008
</div>
10091009

10101010
$scope.transclusionModel = [];

0 commit comments

Comments
 (0)