-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab5.html
More file actions
43 lines (33 loc) · 1011 Bytes
/
lab5.html
File metadata and controls
43 lines (33 loc) · 1011 Bytes
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
<!--
AngularJS - Controllers
how to Creating Controller?
-->
<!DOCTYPE html>
<html >
<head>
<title>AngularJS - Controllers</title>
<meta charset="utf-8" />
<script src="Scripts/angular.js"></script>
<script>
var mainapp = angular.module("myapp", [])
.controller("studentController", function ($scope) {
$scope.student = {
name: 'Amit Kumar Mishra',
Class: 'II',
studentDetail: function () {
return "Name: " + $scope.student.name + " Class: " + $scope.student.Class;
}
};
});
</script>
</head>
<body ng-app="myapp">
<h1>Creating Controllers</h1>
<div ng-controller="studentController">
Enter first name: <input type="text" ng-model="student.name"><br><br>
Enter last name: <input type="text" ng-model="student.Class"><br>
<br>
You are entering: {{student.studentDetail()}}
</div>
</body>
</html>