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

Commit 445ceb0

Browse files
committed
feat(popover): use expression to fix usage with $sce
Allows for trusted resource URLs through Strict Contextual Escaping ($sce). If the an interpolated expression is used instead, then the benefits of SCE is lost. Fixes #3558
1 parent 3d023bc commit 445ceb0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: src/popover/docs/demo.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h4>Dynamic</h4>
1414
</div>
1515
<button popover="{{dynamicPopover.content}}" popover-title="{{dynamicPopover.title}}" class="btn btn-default">Dynamic Popover</button>
1616

17-
<button popover-template="{{dynamicPopover.templateUrl}}" popover-title="{{dynamicPopover.title}}" class="btn btn-default">Popover With Template</button>
17+
<button popover-template="dynamicPopover.templateUrl" popover-title="{{dynamicPopover.title}}" class="btn btn-default">Popover With Template</button>
1818

1919
<script type="text/ng-template" id="myPopoverTemplate.html">
2020
<div>{{dynamicPopover.content}}</div>

Diff for: src/popover/popover.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ angular.module( 'ui.bootstrap.popover', [ 'ui.bootstrap.tooltip' ] )
99
return {
1010
restrict: 'EA',
1111
replace: true,
12-
scope: { title: '@', content: '@', placement: '@', animation: '&', isOpen: '&',
12+
scope: { title: '@', contentExp: '&', placement: '@', animation: '&', isOpen: '&',
1313
originScope: '&' },
1414
templateUrl: 'template/popover/popover-template.html'
1515
};

Diff for: template/popover/popover-template.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="popover-inner">
88
<h3 class="popover-title" ng-bind="title" ng-if="title"></h3>
99
<div class="popover-content"
10-
tooltip-template-transclude="content"
10+
tooltip-template-transclude="contentExp()"
1111
tooltip-template-transclude-scope="originScope()"></div>
1212
</div>
1313
</div>

0 commit comments

Comments
 (0)