docs($window): fix example

This commit is contained in:
Pete Bacon Darwin 2013-05-09 12:42:19 +01:00
parent 29efd39745
commit 02ad012e7f

View file

@ -16,10 +16,23 @@
* @example * @example
<doc:example> <doc:example>
<doc:source> <doc:source>
<input ng-init="$window = $service('$window'); greeting='Hello World!'" type="text" ng-model="greeting" /> <script>
<button ng-click="$window.alert(greeting)">ALERT</button> 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:source>
<doc:scenario> <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:scenario>
</doc:example> </doc:example>
*/ */