I have the code as below which should popup an alert dialog while clicking "Alert AngularJS" button, but it doesn't. Can someone give me some advices?
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.js"/>
<script type="text/javascript">
angular.module('app', []).run(function ($rootScope, $window) {
$rootScope.myAlert = function () {
$window.alert('Hello AngularJS');
};
});
</script>
</head>
<body ng-app="app">
<button ng-click="myAlert()">Alert AngularJS</button>
</body>
</html>