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

Commit

Permalink
feat(popover): use expression to fix usage with $sce
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chrisirhc committed Apr 19, 2015
1 parent 3d023bc commit 445ceb0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/popover/docs/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h4>Dynamic</h4>
</div>
<button popover="{{dynamicPopover.content}}" popover-title="{{dynamicPopover.title}}" class="btn btn-default">Dynamic Popover</button>

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

<script type="text/ng-template" id="myPopoverTemplate.html">
<div>{{dynamicPopover.content}}</div>
Expand Down
2 changes: 1 addition & 1 deletion src/popover/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ angular.module( 'ui.bootstrap.popover', [ 'ui.bootstrap.tooltip' ] )
return {
restrict: 'EA',
replace: true,
scope: { title: '@', content: '@', placement: '@', animation: '&', isOpen: '&',
scope: { title: '@', contentExp: '&', placement: '@', animation: '&', isOpen: '&',
originScope: '&' },
templateUrl: 'template/popover/popover-template.html'
};
Expand Down
2 changes: 1 addition & 1 deletion template/popover/popover-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="popover-inner">
<h3 class="popover-title" ng-bind="title" ng-if="title"></h3>
<div class="popover-content"
tooltip-template-transclude="content"
tooltip-template-transclude="contentExp()"
tooltip-template-transclude-scope="originScope()"></div>
</div>
</div>

0 comments on commit 445ceb0

Please sign in to comment.