-
Notifications
You must be signed in to change notification settings - Fork 0
/
angscope.html
51 lines (35 loc) · 860 Bytes
/
angscope.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
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="angular.js"></script>
<script type="text/javascript">
var app=angular.module('testing-App',[]);
app.controller('ScopingController',function($scope,$log){
// $scope.change=function(){
// console.log($scope.searchtext);
// };
$scope.$log=$log;
$scope.message = 'Hello World!';
Ctrl($scope);
});
function Ctrl($scope)
{
$scope.count=0;
$scope.change=function(){
setTimeout(function() {
$scope.$apply(function(){
$scope.count++;
});
},2000);
}
}
</script>
</head>
<!-- -->
<!-- ng-change="$log.warn(searchtext)" -->
<body ng-app='testing-App' ng-controller="ScopingController">
<input type="text" ng-model="searchtext" ng-change="change()"></input>
{{count}}
</body>
</html>