diff options
Diffstat (limited to 'example/temp.html')
| -rw-r--r-- | example/temp.html | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/example/temp.html b/example/temp.html index d07a6948..8a1246ed 100644 --- a/example/temp.html +++ b/example/temp.html @@ -1,13 +1,36 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html xmlns:ng="http://angularjs.org"> <head> - <script type="text/javascript" src="../src/angular-bootstrap.js#autobind"></script> + <script type="text/javascript" + src="../angular-debug.js" ng:autobind ng:css="css/angular.css"></script> </head> - <body> - {{$location.hashSearch.order}} <br/> - <input type="radio" name="$location.hashSearch.order" value="A"/> A <br/> - <input type="radio" name="$location.hashSearch.order" checked value="B"/> B <br/> - <input type="radio" name="$location.hashSearch.order" value="C"/> C <br/> - {{$location.hashSearch.order}} <br/> + <body ng:init="$window.$root = this"> + +<script> +angular.widget('my:greeter', function(compileElement){ + var compiler = this; + compileElement.css('style', 'block'); + var salutaitonExp = compileElement.attr('salutation'); + var nameExp = compileElement.attr('name'); + return function(linkElement){ + var salutaitonSpan = angular.element('<span class="salutation"></span'); + var nameSpan = angular.element('<span class="name"></span>'); + linkElement.append(salutaitonSpan); + linkElement.append(compiler.text(' ')); + linkElement.append(nameSpan); + linkElement.append(compiler.text('!')); + this.$watch(salutaitonExp, function(value){ + salutaitonSpan.text(value); + }); + this.$watch(nameExp, function(value){ + nameSpan.text(value); + }); + }; +}); +</script> +<div ng:init="salutation='Hello'; name='World'"> + <my:greeter salutation="salutation" name="name"/> +</div> + </body> -</html> +</html>
\ No newline at end of file |
