mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
24 lines
643 B
HTML
24 lines
643 B
HTML
<!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>
|