-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathangularJS_Controller.html
More file actions
43 lines (36 loc) · 1005 Bytes
/
Copy pathangularJS_Controller.html
File metadata and controls
43 lines (36 loc) · 1005 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
<!DOCTYPE html>
<html ng-app>
<head>
<title>AngularJS</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<script type="text/javascript" src="js/angular.min.js"></script>
<script>
function homeController($scope){
$scope.controllerName = 'This is homeController';
$scope.price = 100;
$scope.showText = function(){
return 'Hello, this is showText()';
}
}
function anotherController($scope){
$scope.controllerName='This is anotherController';
}
lastController = function($scope){
$scope.controllerName='This is lastController';
}
</script>
</head>
<body>
<div class="container" >
<h1>AngularJS Controller</h1>
<div ng-controller="homeController">
<h3> {{controllerName+ ' '+ showText()}} </h3>
<input type="number" class="form-control" ng-model="price">
<p>Pricex2: <span ng-bind="price * 2"></span></p>
</div>
<div ng-controller="anotherController">
<h3>{{controllerName}} </h3>
</div>
</div>
</body>
</html>