-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAngularJS Directives
47 lines (41 loc) · 1.18 KB
/
AngularJS Directives
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
<html ng-app= "angular-module">
<head ng-init = "time = 16; s=3; d=9*100/10" >
<script src="angular.js">
</script>
</head>
<body>
<div ng-controller="timeCntrl">
<h1>hello angular. Now the time is {{ftime}} !!</h1>
<p ng-if="true"> Good Morning</p>
<p ng-if="false"> Good Morning</p>
<button ng-click="hi()">hi</button>
</div>
<script>
var mmodule = angular.module("angular-module",[]);
mmodule.controller("timeCntrl",displayDay);
mmodule.controller("timeCntrl",displayTime);
function displayTime($scope)
{
$scope.hi = function()
{
alert("hiiii");
ftime="hi mine";
}
$scope.ftime = "12" + ""+new Date().getDate();;
console.log("time is"+ new Date().getTime());
alert("in time");
}
function displayDay()
{
console.log("day is"+ new Date().getDay());
}
</script>
<p ng-if="s == 3"> s Good Morning</p>
<p ng-if="time < 12"> Good Morning</p>
<p ng-if="d < 99"> 9 Good Afternoon</p>
</html>
<html>
<p ng-if="time > 12"> non ang Good Afternoon</p>
<p ng-bind = "sru">cc</p>
{{d}}
</html>