Reputation: 181
I have used the angular-strap 'bs-popover' directive to open a popover using a custom html template. Following is the code sample which calls the directive when an input field is clicked.
<div ng-controller="ctrl">
<input size="6" type="text" ng-model="cell.HHmm__c" data-template= "/projectA/v/d/views/popoverTemplate.html" data-animation="am-flip-x" bs-popover="popover"></input>
</div>
Everything is working fine. However, now I want to set the data-template using a string variable in my controller. As an example, assume I have a variable
$scope.templatePath = "/projectA/v/d/views/popoverTemplate.html"
in my controller ctrl. If so, how do I assign the variable templatePath as the data-template path in my bs-popover directive?
Upvotes: 1
Views: 930
Reputation: 136184
You can have two way to do this
ng-attr-data-template="{{templatePath}}"
OR
data-template="{{templatePath}}"
Hope this could help you, Thanks.
Upvotes: 1