diff options
| author | Pete Bacon Darwin | 2013-05-09 12:42:19 +0100 | 
|---|---|---|
| committer | Pete Bacon Darwin | 2013-05-09 12:47:41 +0100 | 
| commit | 02ad012e7fee59f989f688a7171a2158371dcf11 (patch) | |
| tree | f83ee7b4e47753fa4f47e43312721779f9ecaa56 /src/ng/window.js | |
| parent | 29efd39745ac14c89ef8bc79993b51450fd0a8b9 (diff) | |
| download | angular.js-02ad012e7fee59f989f688a7171a2158371dcf11.tar.bz2 | |
docs($window): fix example
Diffstat (limited to 'src/ng/window.js')
| -rw-r--r-- | src/ng/window.js | 17 | 
1 files changed, 15 insertions, 2 deletions
| diff --git a/src/ng/window.js b/src/ng/window.js index 8eec7cba..03e0ff5d 100644 --- a/src/ng/window.js +++ b/src/ng/window.js @@ -16,10 +16,23 @@   * @example     <doc:example>       <doc:source> -       <input ng-init="$window = $service('$window'); greeting='Hello World!'" type="text" ng-model="greeting" /> -       <button ng-click="$window.alert(greeting)">ALERT</button> +       <script> +         function Ctrl($scope, $window) { +           $scope.$window = $window; +           $scope.greeting = 'Hello, World!'; +         } +       </script> +       <div ng-controller="Ctrl"> +         <input type="text" ng-model="greeting" /> +         <button ng-click="$window.alert(greeting)">ALERT</button> +       </div>       </doc:source>       <doc:scenario> +      it('should display the greeting in the input box', function() { +       input('greeting').enter('Hello, E2E Tests'); +       // If we click the button it will block the test runner +       // element(':button').click(); +      });       </doc:scenario>     </doc:example>   */ | 
