diff options
| author | Igor Minar | 2011-01-04 16:39:05 -0800 |
|---|---|---|
| committer | Igor Minar | 2011-01-04 18:04:01 -0800 |
| commit | 67d064820c0a7993fdb3d15d6ee0b07a31c19f08 (patch) | |
| tree | 9fdf5a10532128dfb37630bb0bd862048ffcc11d /example | |
| parent | b2631f61709ae71bb29ec6f1353f2a3c1ad33cd3 (diff) | |
| download | angular.js-67d064820c0a7993fdb3d15d6ee0b07a31c19f08.tar.bz2 | |
fixing up personalLog app
Diffstat (limited to 'example')
| -rw-r--r-- | example/personalLog/personalLog.html | 2 | ||||
| -rw-r--r-- | example/personalLog/scenario/personalLogScenario.js | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/example/personalLog/personalLog.html b/example/personalLog/personalLog.html index 6915b9a0..9d3af77d 100644 --- a/example/personalLog/personalLog.html +++ b/example/personalLog/personalLog.html @@ -9,7 +9,7 @@ <!-- TODO: we need to expose $root so that we can delete cookies in the scenario runner, there must be a better way to do this --> - <body ng:controller="example.personalLog.LogCtrl" ng:init="$window.$root = $root"> + <body ng:controller="example.personalLog.LogCtrl"> <form action="" ng:submit="addLog(newMsg)"> <input type="text" name="newMsg" /> diff --git a/example/personalLog/scenario/personalLogScenario.js b/example/personalLog/scenario/personalLogScenario.js index 4b6d4ae5..5baeeb1a 100644 --- a/example/personalLog/scenario/personalLogScenario.js +++ b/example/personalLog/scenario/personalLogScenario.js @@ -81,15 +81,14 @@ angular.scenario.dsl('clearCookies', function() { */ return function() { this.addFutureAction('clear all cookies', function($window, $document, done) { - //TODO: accessing angular services is pretty nasty, we need a better way to reach them - var $cookies = $window.$root.$cookies, + var rootScope = $window.angular.element($document[0]).data('$scope'), + $cookies = rootScope.$service('$cookies'), cookieName; for (cookieName in $cookies) { - console.log('deleting cookie: ' + cookieName); delete $cookies[cookieName]; } - $window.$root.$eval(); + rootScope.$eval(); done(); }); |
