You could create a directive that will load the script into DOM dynamically.
Markup
<load-script ng-if="data" data="data"></load-script>
Directive
app.directive('loadScript', function($compile){ return { restrict: 'E', scope: {'data': '=' }, link: function(scope, element, attrs){ element.append($compile(scope.data)(scope)) } }})