-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path5.html
33 lines (27 loc) · 916 Bytes
/
5.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<title>AngularJS Button Manipulation</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
</head>
<body ng-controller="myCtrl">
<button ng-show="showClickMe" ng-click="clickMe()">Click Me!</button>
<button ng-click="hideMe()">Hide Me!</button>
<button ng-click="showMe()">Show Me!</button>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.showClickMe = true;
$scope.clickMe = function() {
// Nothing happens when 'Click Me!' is clicked
};
$scope.hideMe = function() {
$scope.showClickMe = false; // Hide 'Click Me!' button
};
$scope.showMe = function() {
$scope.showClickMe = true; // Show 'Click Me!' button
};
});
</script>
</body>
</html>