-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.html
43 lines (36 loc) · 995 Bytes
/
notes.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
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body ng-app="myNoteApp" ng-controller="myNoteCtrl" background="d.jpeg">
<center>
<a href="page.html">Back to Main Page</a>
<h2>Notes</h2>
<textarea ng-model="message" cols="40" rows="10"></textarea>
<p>
<button ng-click="save()">Save</button>
<button ng-click="clear()">Clear</button>
<button ng-click="about()">About</button>
</p>
<p>Number of characters left: <span ng-bind="left()"></span></p>
<script>
var app = angular.module("myNoteApp", []);
app.controller("myNoteCtrl", function($scope) {
$scope.message = "";
$scope.left = function() {
return 500 - $scope.message.length;
};
$scope.clear = function() {
$scope.message = "";
};
$scope.save = function() {
alert("Note Saved");
};
$scope.about = function() {
alert("Welcome ");
$scope.message = "Welcome";
};
});
</script>
</center>
</body>
</html>