Skip to content

Commit

Permalink
dont know what is that
Browse files Browse the repository at this point in the history
  • Loading branch information
Freewind committed Jan 4, 2015
1 parent 631fa46 commit af7ffe2
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 1 deletion.
54 changes: 53 additions & 1 deletion _posts/2014-11-26-2818-???.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,56 @@ alias: ???
tags: ???
date: 2014-11-26 22:00:48
title: ???
---
---

```js
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-example93-production</title>


<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js"></script>

<style>
.red {
background-color: red;
}
</style>

</head>
<body ng-app="transcludeExample">
<script>
angular.module('transcludeExample', [])
.directive('pane', function(){
return {
restrict: 'A',
transclude: true,

link: function(scope, element) {
scope.user = {
name: "Freewind"
}
},
template: '<div class="red">' +
'<div>{{title}}</div>' +
'<ng-transclude></ng-transclude>' +
'</div>'
};
})
.controller('ExampleController', ['$scope', function($scope) {
$scope.titles = ["aa", "bb"]

}]);
</script>
<div ng-controller="ExampleController">
<ul>
<li ng-repeat="title in titles" pane title="{{title}}">
[[ {{user.name}} ]]
</li>
</ul>
</div>
</body>
</html>
```
28 changes: 28 additions & 0 deletions _posts/2014-12-10-2820-???.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
layout: post
id: 2820
alias: ???
tags: ???
date: 2014-12-10 11:44:36
title: ???
---

在做Angular项目时,我们积累了一些使用protractor写测试的经验。

## 等待某个操作完成

有时候我们点击了某个按钮触发了某个操作后,需要等待一段短暂的时间那个操作才能完成。这时在我们的测试中,我们就需要以某种方式,等那个操作完成后,才能继续后面的测试。

我们可以使用`browser.wait`来实现这个功能。

```js
var button = $("#pop-button");
button.click();

var dialog = $(".dialog");
browser.wait(function() {
return dialog.isDisplayed();
}, 2000);
```

0 comments on commit af7ffe2

Please sign in to comment.