Quantcast
Channel: Is there a way to load data into script - Stack Overflow
Browsing index pages (3 articles)

Is there a way to load data into script

So in Angular i'm trying to do$scope.data = "<script> alert('hi'); </script>";But unfortunately that doesn't work. I also tried to add ng-bind-html but without any results.{{data}}also I...

View Article


Answer by Noam for Is there a way to load data into script

Your $scope will be already either within a <script> block or in a Javascript file. Now, when/how do you want the alert to be called? If I understand correctly what you're trying to do, here's...

View Article


Answer by Pankaj Parkar for Is there a way to load data into script

You could create a directive that will load the script into DOM dynamically.Markup<load-script ng-if="data" data="data"></load-script>Directiveapp.directive('loadScript',...

View Article
Browsing index pages (3 articles)


Latest Images