angularjs: allow $q.when to be called w/o args

The current definition does not cover the case that the input type is
void.
This commit is contained in:
Tobias Bengfort
2014-07-21 11:09:13 +02:00
parent 5326ecda45
commit fe47b495c8
2 changed files with 12 additions and 0 deletions

View File

@@ -139,6 +139,12 @@ module HttpAndRegularPromiseTests {
dPromise.then((snack: string) => {
$scope.snack = snack;
});
// $q.when may be called without arguments
var ePromise: ng.IPromise<Person> = $q.when();
ePromise.then(() => {
$scope.nothing = "really nothing";
});
}
// Test that we can pass around a type-checked success/error Promise Callback