I try to compile HTML template with <script>..</script>
inside the file, but AngularJS compiler doesn't compile all expressions within <script>
tag.
My controller:
.controller('showChannelController', function ($scope, $http, $stateParams, $compile, $templateRequest) {
$http.get("http://localhost/show?id=" + $stateParams.id)
.then(function (response) {
$scope.info = response.data.data;
$templateRequest('application/script.html').then(function(template) {
$('body').append($compile(template)($scope));
});
});
});
And my application/script.html
template looks like:
<script>
$(function() {
// Load Player
var player = new Clappr.Player({
source: "{{source_url}}",
parentId: "#player",
autoPlay: true,
width: 962,
height: 540,
});
});
</script>
Is it possible resolve this issue without include backend?