Skip to content

Commit 02ad012

Browse files
docs($window): fix example
1 parent 29efd39 commit 02ad012

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/ng/window.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,23 @@
1616
* @example
1717
<doc:example>
1818
<doc:source>
19-
<input ng-init="$window = $service('$window'); greeting='Hello World!'" type="text" ng-model="greeting" />
20-
<button ng-click="$window.alert(greeting)">ALERT</button>
19+
<script>
20+
function Ctrl($scope, $window) {
21+
$scope.$window = $window;
22+
$scope.greeting = 'Hello, World!';
23+
}
24+
</script>
25+
<div ng-controller="Ctrl">
26+
<input type="text" ng-model="greeting" />
27+
<button ng-click="$window.alert(greeting)">ALERT</button>
28+
</div>
2129
</doc:source>
2230
<doc:scenario>
31+
it('should display the greeting in the input box', function() {
32+
input('greeting').enter('Hello, E2E Tests');
33+
// If we click the button it will block the test runner
34+
// element(':button').click();
35+
});
2336
</doc:scenario>
2437
</doc:example>
2538
*/

0 commit comments

Comments
 (0)