I'm trying to add paypal's pay button to my angularjs app,
$scope.paypal ='<script async="async" src="https://www.paypalobjects.com/js/external/paypal-button.min.js?merchant=DJOEURGOJ97S"'+
'data-button="buynow"'+
'data-name="socks"'+
'data-quantity="1"'+
'data-amount="{{dollarValue}}"'+
'data-currency="USD"'+
'data-shipping="0"'+
'data-tax="0"'+
'data-callback="https://gamerhoic.com/ipn/data.php"'+
'></script>';
It would be so awesome IF it was just that easy.
I've tried a number of suggestions including adding ng-santize and $sce.trustAsHtml;
$sce.trustAsHtml('<script></script>');
I read through Binding data in Angular js in string added via $sce.trustAsHtml thoroughly but it's a bit more complex than what I'm doing
using $sce.trustAtHtml nothing renders. If I add {{paypal}} I obviously get the $scope.paypal '' text displayed
<div bind-unsafe-html="paypal">{{paypal}}</div>
See Question&Answers more detail:os