Fix $q.when definition

This commit is contained in:
unknown
2014-03-14 11:13:07 -04:00
parent c4b432a01f
commit bd9d835aa7
2 changed files with 8 additions and 0 deletions

View File

@@ -94,6 +94,7 @@ module HttpAndRegularPromiseTests {
person: Person;
theAnswer: number;
letters: string[];
snack: string;
}
var someController: Function = ($scope: SomeControllerScope, $http: ng.IHttpService, $q: ng.IQService) => {
@@ -132,6 +133,12 @@ module HttpAndRegularPromiseTests {
cPromise.then((letters: string[]) => {
$scope.letters = letters;
});
// When $q.when is passed an IPromise<T>, it returns an IPromise<T>
var dPromise: ng.IPromise<string> = $q.when($q.when("ALBATROSS!"));
dPromise.then((snack: string) => {
$scope.snack = snack;
});
}
// Test that we can pass around a type-checked success/error Promise Callback