diff options
| author | Misko Hevery | 2010-09-22 13:24:40 +0200 |
|---|---|---|
| committer | Misko Hevery | 2010-09-22 16:17:44 +0200 |
| commit | 0649009624e8e7bd6fb39537f62c6f00facbfb16 (patch) | |
| tree | e85077e148220ce75926bffce2d1e7daf8069945 /scenario | |
| parent | eefb920d0e0345485a8eb120aeecc3b1aa9f6719 (diff) | |
| download | angular.js-0649009624e8e7bd6fb39537f62c6f00facbfb16.tar.bz2 | |
Refactored the Browser:
- change from using prototype to inner functions to help with better compression
- removed watchers (url/cookie) and introduced a poller concept
- moved the checking of URL and cookie into services which register with poolers
Benefits:
- Smaller minified file
- can call $browser.poll() from tests to simulate polling
- single place where setTimeout needs to be tested
- More testable $browser
Diffstat (limited to 'scenario')
| -rw-r--r-- | scenario/browser.html | 22 | ||||
| -rw-r--r-- | scenario/widgets.html | 6 |
2 files changed, 25 insertions, 3 deletions
diff --git a/scenario/browser.html b/scenario/browser.html new file mode 100644 index 00000000..eac43692 --- /dev/null +++ b/scenario/browser.html @@ -0,0 +1,22 @@ +<!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" ng:autobind></script> + </head> + <body ng:init="$window.$scope = this"> + + <h1>Should mark input field red and create hover</h1> + <input type="text" name="name" ng:required/> + + <h1>Should reflect changes in URL</h1> + <pre>$location={{$location}}</pre> + hash: <input type="text" name="$location.hash"/> <br/> + hashPath: <input type="text" name="$location.hashPath"/> <br/> + hashSearch: <input type="text" name="$location.hashSearch" ng:format="json"/> <br/> + + <h1>Should reflect changes in Cookie</h1> + <pre>$cookies={{$cookies}}</pre> + $cookies: <input type="text" name="$cookies" ng:format="json"/> <br/> + + </body> + </html> diff --git a/scenario/widgets.html b/scenario/widgets.html index d5285ea6..08443d2a 100644 --- a/scenario/widgets.html +++ b/scenario/widgets.html @@ -1,8 +1,8 @@ - <!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 XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns:ng="http://angularjs.org"> <head> <link rel="stylesheet" type="text/css" href="style.css"/> - <script type="text/javascript" src="../src/angular-bootstrap.js#autobind"></script> + <script type="text/javascript" src="../src/angular-bootstrap.js" ng:autobind></script> </head> <body ng:init="$window.$scope = this"> <table> |
