2018-01-06 20:45:13 +01:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
|
|
|
|
<body ng-app="myApp">
|
|
|
|
|
|
|
|
<!-- target: hello.txt -->
|
|
|
|
|
|
|
|
<div ng-controller="myCtrl">
|
|
|
|
<p>Click the button to run a function:</p>
|
2018-01-06 21:22:12 +01:00
|
|
|
<p id="link" ng-click="myFunc()">OK</p>
|
2018-01-06 20:45:13 +01:00
|
|
|
<p>The button has been clicked {{count}} times.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
angular.module('myApp', [])
|
|
|
|
.controller('myCtrl', ['$scope', function($scope) {
|
|
|
|
$scope.count = 0;
|
|
|
|
$scope.myFunc = function() {
|
|
|
|
$scope.count++;
|
|
|
|
window.location = "hello.txt";
|
|
|
|
};
|
|
|
|
}]);
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|