mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
docs($window): fix example
This commit is contained in:
parent
016e1e675e
commit
1e99ea6a51
1 changed files with 15 additions and 2 deletions
|
|
@ -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>
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue