blob: 84e5e732c3560bc50f59ba3dd980fe3441666766 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<!DOCTYPE html>
<html xmlns:ng="http://angularjs.org" xmlns:my="http://mynamespace.org">
<head>
<style>
my\:time {color:#00f;display:block;border:1px solid #ccc;background-color:#ddd;}
</style>
<script src="../build/angular.js" ng:autobind></script>
<script>
angular.widget('my:time', function(compileElement){
compileElement.css('display', 'block');
return function(linkElement) {
function update() {
linkElement.text('Current time is: ' + new Date());
setTimeout(update, 1000);
}
update();
};
});
</script>
</head>
<body>
<my:time></my:time>
</body>
</html>
|