updated angular-odata-resources definitions to have support count and inlinecount

This commit is contained in:
Raphael ATALLAH
2015-07-21 15:30:27 -07:00
parent 2eef2bef0a
commit addd4957b0
2 changed files with 18 additions and 1 deletions

View File

@@ -186,4 +186,14 @@ var combination2 = Predicate.and([combination1, predicate2]);
var predicate = new Predicate("FirstName", "John")
.or(new Predicate("LastName", '!=', "Doe"))
.and(new Predicate("Age", '>', 10));
.and(new Predicate("Age", '>', 10));
users = odataResourceClass.odata()
.withInlineCount()
.query();
var countResult = odataResourceClass.odata().count();
var total = countResult.result;

View File

@@ -264,6 +264,11 @@ declare module OData {
(queryString: string, success: () => any, error: () => any): T[];
(queryString: string, success: () => any, error: () => any, isSingleElement?: boolean, forceSingleElement?: boolean): T;
}
interface ICountResult{
result: number;
}
class Provider<T> {
private callback;
private filters;
@@ -281,6 +286,8 @@ declare module OData {
single(success?: any, error?: any): T;
get(data: any, success?: any, error?: any): T;
expand(params: any, otherParam1?: any, otherParam2?: any, otherParam3?: any, otherParam4?: any, otherParam5?: any, otherParam6?: any, otherParam7?: any): Provider<T>;
count(success?: (result: ICountResult) => any, error?: () => any);
withInlineCount();
}
interface ValueFactory {