Quantcast
Channel: Is there a way to load data into script - Stack Overflow
Viewing all articles
Browse latest Browse all 3

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

$
0
0

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 how to do it:

<div ng-click="doAlert()">  Click here to see an alert</div>

and in your controller:

$scope.doAlert = function() {   alert('hi);};

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>