Skip to content

Commit

Permalink
updated angular-odata-resources definitions to have support count and…
Browse files Browse the repository at this point in the history
… inlinecount
  • Loading branch information
Raphael ATALLAH committed Jul 21, 2015
1 parent 2eef2be commit addd495
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
12 changes: 11 additions & 1 deletion angular-odata-resources/angular-odata-resources-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

7 changes: 7 additions & 0 deletions angular-odata-resources/angular-odata-resources.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down

0 comments on commit addd495

Please sign in to comment.