Return typed definition from toJSON method (#8859)

* Return typed definition from toJSON method

* Test toJSON returns IMyResource
This commit is contained in:
Ken Howard
2016-04-12 07:22:09 -07:00
committed by Masahiro Wakame
parent 22d18908f7
commit e684481e0c
2 changed files with 2 additions and 6 deletions

View File

@@ -98,9 +98,7 @@ resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () {
var promise : angular.IPromise<IMyResource>;
var arrayPromise : angular.IPromise<IMyResource[]>;
var json: {
[index: string]: any;
};
var json: IMyResource;
promise = resource.$delete();
promise = resource.$delete({ key: 'value' });

View File

@@ -153,9 +153,7 @@ declare namespace angular.resource {
/** the promise of the original server interaction that created this instance. **/
$promise : angular.IPromise<T>;
$resolved : boolean;
toJSON: () => {
[index: string]: any;
}
toJSON(): T;
}
/**