mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 12:42:58 +08:00
Merge pull request #7034 from Brooooooklyn/issue/angular-resource
fix(angularjs): add toJSON method
This commit is contained in:
@@ -89,6 +89,9 @@ resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () {
|
||||
|
||||
var promise : angular.IPromise<IMyResource>;
|
||||
var arrayPromise : angular.IPromise<IMyResource[]>;
|
||||
var json: {
|
||||
[index: string]: any;
|
||||
};
|
||||
|
||||
promise = resource.$delete();
|
||||
promise = resource.$delete({ key: 'value' });
|
||||
@@ -127,6 +130,8 @@ promise = resource.$save(function () { });
|
||||
promise = resource.$save(function () { }, function () { });
|
||||
promise = resource.$save({ key: 'value' }, function () { }, function () { });
|
||||
|
||||
json = resource.toJSON();
|
||||
|
||||
///////////////////////////////////////
|
||||
// IResourceService
|
||||
///////////////////////////////////////
|
||||
|
||||
3
angularjs/angular-resource.d.ts
vendored
3
angularjs/angular-resource.d.ts
vendored
@@ -136,6 +136,9 @@ declare module angular.resource {
|
||||
/** the promise of the original server interaction that created this instance. **/
|
||||
$promise : angular.IPromise<T>;
|
||||
$resolved : boolean;
|
||||
toJSON: () => {
|
||||
[index: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user